@pol-studios/powersync 1.0.6 → 1.0.10

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 (128) hide show
  1. package/README.md +933 -0
  2. package/dist/CacheSettingsManager-uz-kbnRH.d.ts +461 -0
  3. package/dist/attachments/index.d.ts +745 -332
  4. package/dist/attachments/index.js +152 -6
  5. package/dist/{types-Cd7RhNqf.d.ts → background-sync-ChCXW-EV.d.ts} +53 -2
  6. package/dist/chunk-24RDMMCL.js +44 -0
  7. package/dist/chunk-24RDMMCL.js.map +1 -0
  8. package/dist/chunk-4TXTAEF2.js +2060 -0
  9. package/dist/chunk-4TXTAEF2.js.map +1 -0
  10. package/dist/chunk-63PXSPIN.js +358 -0
  11. package/dist/chunk-63PXSPIN.js.map +1 -0
  12. package/dist/chunk-654ERHA7.js +1 -0
  13. package/dist/chunk-A4IBBWGO.js +377 -0
  14. package/dist/chunk-A4IBBWGO.js.map +1 -0
  15. package/dist/chunk-BRXQNASY.js +1720 -0
  16. package/dist/chunk-BRXQNASY.js.map +1 -0
  17. package/dist/chunk-CAB26E6F.js +142 -0
  18. package/dist/chunk-CAB26E6F.js.map +1 -0
  19. package/dist/{chunk-EJ23MXPQ.js → chunk-CGL33PL4.js} +3 -1
  20. package/dist/chunk-CGL33PL4.js.map +1 -0
  21. package/dist/{chunk-R4YFWQ3Q.js → chunk-CUCAYK7Z.js} +309 -92
  22. package/dist/chunk-CUCAYK7Z.js.map +1 -0
  23. package/dist/chunk-FV2HXEIY.js +124 -0
  24. package/dist/chunk-FV2HXEIY.js.map +1 -0
  25. package/dist/chunk-HWSNV45P.js +279 -0
  26. package/dist/chunk-HWSNV45P.js.map +1 -0
  27. package/dist/{chunk-62J2DPKX.js → chunk-KN2IZERF.js} +530 -413
  28. package/dist/chunk-KN2IZERF.js.map +1 -0
  29. package/dist/{chunk-7EMDVIZX.js → chunk-N75DEF5J.js} +19 -1
  30. package/dist/chunk-N75DEF5J.js.map +1 -0
  31. package/dist/chunk-P4HZA6ZT.js +83 -0
  32. package/dist/chunk-P4HZA6ZT.js.map +1 -0
  33. package/dist/chunk-P6WOZO7H.js +49 -0
  34. package/dist/chunk-P6WOZO7H.js.map +1 -0
  35. package/dist/chunk-T4AO7JIG.js +1 -0
  36. package/dist/chunk-TGBT5XBE.js +1 -0
  37. package/dist/{chunk-FPTDATY5.js → chunk-VACPAAQZ.js} +54 -12
  38. package/dist/chunk-VACPAAQZ.js.map +1 -0
  39. package/dist/chunk-WGHNIAF7.js +329 -0
  40. package/dist/chunk-WGHNIAF7.js.map +1 -0
  41. package/dist/{chunk-3AYXHQ4W.js → chunk-WN5ZJ3E2.js} +108 -47
  42. package/dist/chunk-WN5ZJ3E2.js.map +1 -0
  43. package/dist/chunk-XAEII4ZX.js +456 -0
  44. package/dist/chunk-XAEII4ZX.js.map +1 -0
  45. package/dist/chunk-XOY2CJ67.js +289 -0
  46. package/dist/chunk-XOY2CJ67.js.map +1 -0
  47. package/dist/chunk-YHTZ7VMV.js +1 -0
  48. package/dist/chunk-YSTEESEG.js +676 -0
  49. package/dist/chunk-YSTEESEG.js.map +1 -0
  50. package/dist/chunk-Z6VOBGTU.js +32 -0
  51. package/dist/chunk-Z6VOBGTU.js.map +1 -0
  52. package/dist/chunk-ZM4ENYMF.js +230 -0
  53. package/dist/chunk-ZM4ENYMF.js.map +1 -0
  54. package/dist/connector/index.d.ts +236 -4
  55. package/dist/connector/index.js +15 -4
  56. package/dist/core/index.d.ts +16 -3
  57. package/dist/core/index.js +6 -2
  58. package/dist/error/index.d.ts +54 -0
  59. package/dist/error/index.js +7 -0
  60. package/dist/error/index.js.map +1 -0
  61. package/dist/index.d.ts +102 -12
  62. package/dist/index.js +309 -37
  63. package/dist/index.native.d.ts +22 -10
  64. package/dist/index.native.js +309 -38
  65. package/dist/index.web.d.ts +22 -10
  66. package/dist/index.web.js +310 -38
  67. package/dist/maintenance/index.d.ts +118 -0
  68. package/dist/maintenance/index.js +16 -0
  69. package/dist/maintenance/index.js.map +1 -0
  70. package/dist/platform/index.d.ts +16 -1
  71. package/dist/platform/index.js.map +1 -1
  72. package/dist/platform/index.native.d.ts +2 -2
  73. package/dist/platform/index.native.js +1 -1
  74. package/dist/platform/index.web.d.ts +1 -1
  75. package/dist/platform/index.web.js +1 -1
  76. package/dist/pol-attachment-queue-BVAIueoP.d.ts +817 -0
  77. package/dist/provider/index.d.ts +451 -21
  78. package/dist/provider/index.js +32 -13
  79. package/dist/react/index.d.ts +372 -0
  80. package/dist/react/index.js +25 -0
  81. package/dist/react/index.js.map +1 -0
  82. package/dist/storage/index.d.ts +6 -0
  83. package/dist/storage/index.js +42 -0
  84. package/dist/storage/index.js.map +1 -0
  85. package/dist/storage/index.native.d.ts +6 -0
  86. package/dist/storage/index.native.js +40 -0
  87. package/dist/storage/index.native.js.map +1 -0
  88. package/dist/storage/index.web.d.ts +6 -0
  89. package/dist/storage/index.web.js +40 -0
  90. package/dist/storage/index.web.js.map +1 -0
  91. package/dist/storage/upload/index.d.ts +54 -0
  92. package/dist/storage/upload/index.js +15 -0
  93. package/dist/storage/upload/index.js.map +1 -0
  94. package/dist/storage/upload/index.native.d.ts +56 -0
  95. package/dist/storage/upload/index.native.js +15 -0
  96. package/dist/storage/upload/index.native.js.map +1 -0
  97. package/dist/storage/upload/index.web.d.ts +2 -0
  98. package/dist/storage/upload/index.web.js +14 -0
  99. package/dist/storage/upload/index.web.js.map +1 -0
  100. package/dist/supabase-connector-T9vHq_3i.d.ts +202 -0
  101. package/dist/sync/index.d.ts +288 -23
  102. package/dist/sync/index.js +22 -10
  103. package/dist/{index-l3iL9Jte.d.ts → types-B212hgfA.d.ts} +101 -158
  104. package/dist/{types-afHtE1U_.d.ts → types-CDqWh56B.d.ts} +2 -0
  105. package/dist/types-CyvBaAl8.d.ts +60 -0
  106. package/dist/types-D0WcHrq6.d.ts +234 -0
  107. package/package.json +89 -5
  108. package/dist/chunk-32OLICZO.js +0 -1
  109. package/dist/chunk-3AYXHQ4W.js.map +0 -1
  110. package/dist/chunk-5FIMA26D.js +0 -1
  111. package/dist/chunk-62J2DPKX.js.map +0 -1
  112. package/dist/chunk-7EMDVIZX.js.map +0 -1
  113. package/dist/chunk-EJ23MXPQ.js.map +0 -1
  114. package/dist/chunk-FPTDATY5.js.map +0 -1
  115. package/dist/chunk-KCDG2MNP.js +0 -1431
  116. package/dist/chunk-KCDG2MNP.js.map +0 -1
  117. package/dist/chunk-OLHGI472.js +0 -1
  118. package/dist/chunk-PAFBKNL3.js +0 -99
  119. package/dist/chunk-PAFBKNL3.js.map +0 -1
  120. package/dist/chunk-R4YFWQ3Q.js.map +0 -1
  121. package/dist/chunk-V6LJ6MR2.js +0 -740
  122. package/dist/chunk-V6LJ6MR2.js.map +0 -1
  123. package/dist/chunk-VJCL2SWD.js +0 -1
  124. package/dist/failed-upload-store-C0cLxxPz.d.ts +0 -33
  125. /package/dist/{chunk-32OLICZO.js.map → chunk-654ERHA7.js.map} +0 -0
  126. /package/dist/{chunk-5FIMA26D.js.map → chunk-T4AO7JIG.js.map} +0 -0
  127. /package/dist/{chunk-OLHGI472.js.map → chunk-TGBT5XBE.js.map} +0 -0
  128. /package/dist/{chunk-VJCL2SWD.js.map → chunk-YHTZ7VMV.js.map} +0 -0
@@ -1,26 +1,159 @@
1
- import "./chunk-OLHGI472.js";
2
- import "./chunk-32OLICZO.js";
1
+ import "./chunk-654ERHA7.js";
2
+ import {
3
+ SlimPowerSyncProvider,
4
+ useAttachmentQueueContext,
5
+ usePowerSyncContext,
6
+ useSyncStatusContext
7
+ } from "./chunk-63PXSPIN.js";
8
+ import {
9
+ DOWNLOAD_WORKFLOW_STATES,
10
+ STATE_MAPPING,
11
+ STATE_NAMES,
12
+ TERMINAL_STATES,
13
+ UPLOAD_WORKFLOW_STATES,
14
+ VALID_STATES,
15
+ buildIdOnlyWatchQuery,
16
+ buildRecordFetchQuery,
17
+ buildWatchQuery,
18
+ createMigrationStats,
19
+ formatMigrationStats,
20
+ getStateName,
21
+ isDownloadWorkflowState,
22
+ isTerminalState,
23
+ isUploadWorkflowState,
24
+ isValidAttachmentState,
25
+ migrateAttachmentState,
26
+ migrateAttachmentStateSafe,
27
+ recordMigration,
28
+ validateSqlIdentifier as validateSqlIdentifier2,
29
+ validateWhereClause,
30
+ watchConfigToSourceConfig
31
+ } from "./chunk-ZM4ENYMF.js";
32
+ import {
33
+ ConflictBus,
34
+ OfflineDataProvider,
35
+ PowerSyncProvider,
36
+ ProviderBridge
37
+ } from "./chunk-BRXQNASY.js";
38
+ import "./chunk-YHTZ7VMV.js";
39
+ import {
40
+ PowerSyncErrorBoundary
41
+ } from "./chunk-P6WOZO7H.js";
42
+ import {
43
+ ATTACHMENT_TABLE,
44
+ AbstractAttachmentQueue,
45
+ AttachmentState,
46
+ AttachmentTable,
47
+ CACHE_SIZE_PRESETS,
48
+ DEFAULT_ATTACHMENT_QUEUE_OPTIONS,
49
+ DEFAULT_CACHE_CONFIG,
50
+ DEFAULT_COMPRESSION_CONFIG,
51
+ DEFAULT_DOWNLOAD_CONFIG,
52
+ DEFAULT_UPLOAD_CONFIG,
53
+ EncodingType,
54
+ LOCALLY_AVAILABLE_STATES,
55
+ PENDING_DOWNLOAD_STATES,
56
+ PROTECTED_UPLOAD_STATES,
57
+ PolAttachmentQueue,
58
+ PolAttachmentState,
59
+ PolStorageAdapter,
60
+ blobToArrayBuffer,
61
+ cacheLocalFile,
62
+ clearCache,
63
+ clearUploadCallback,
64
+ copyToManagedCache,
65
+ createCacheManagerDeps,
66
+ createPolAttachmentQueue,
67
+ createUploadManagerDeps,
68
+ createUploadManagerState,
69
+ determineAttachmentState,
70
+ downloadRecord,
71
+ enforceCacheLimit,
72
+ ensureFileUri,
73
+ extractErrorCode,
74
+ formatCacheSize,
75
+ getCachedSize,
76
+ getEvictionCandidates,
77
+ getExcludeProtectedStatesCondition,
78
+ getExtensionFromMimeType,
79
+ getFailedPermanentUploads,
80
+ getLocalUriForStoragePath,
81
+ getMimeType,
82
+ getMimeTypeFromPath,
83
+ getPendingUploads,
84
+ getProtectedStatesInClause,
85
+ getSoonestRetryTime,
86
+ getStaleUploads,
87
+ getSyncedUploadsWithPendingCallback,
88
+ isAudioMimeType,
89
+ isCacheNearCapacity,
90
+ isDocumentMimeType,
91
+ isImageMimeType,
92
+ isLocallyAvailable,
93
+ isPendingDownloadState,
94
+ isPermanentError,
95
+ isProtectedUploadState,
96
+ isStateTransitionAllowed,
97
+ isVideoMimeType,
98
+ markUploadPermanentFailure,
99
+ markUploadSynced,
100
+ scheduleUploadRetry,
101
+ startUploadProcessing,
102
+ stripFileUri,
103
+ uploadOne,
104
+ validateSqlIdentifier
105
+ } from "./chunk-4TXTAEF2.js";
106
+ import {
107
+ DeadLetterQueue,
108
+ createDeadLetterEntry,
109
+ defineBackgroundSyncTask,
110
+ generateDLQEntryId,
111
+ initializeBackgroundSync,
112
+ isBackgroundSyncRegistered,
113
+ registerBackgroundSync,
114
+ unregisterBackgroundSync
115
+ } from "./chunk-A4IBBWGO.js";
116
+ import {
117
+ HealthMonitor,
118
+ MetricsCollector,
119
+ SyncStatusTracker
120
+ } from "./chunk-CUCAYK7Z.js";
121
+ import {
122
+ DEFAULT_CONNECTION_HEALTH,
123
+ DEFAULT_SYNC_CONFIG,
124
+ DEFAULT_SYNC_METRICS,
125
+ DEFAULT_SYNC_STATUS
126
+ } from "./chunk-24RDMMCL.js";
127
+ import {
128
+ checkIntegrityImpl,
129
+ checkStorageQuotaImpl,
130
+ compactDatabaseImpl,
131
+ formatBytes,
132
+ getCacheStatsImpl,
133
+ useDatabaseMaintenance
134
+ } from "./chunk-WGHNIAF7.js";
3
135
  import {
4
136
  AttachmentQueueContext,
5
137
  CompletedTransactionsContext,
6
- ConflictBus,
7
138
  ConnectionHealthContext,
8
139
  ConnectionStatusContext,
9
140
  FailedTransactionsContext,
10
141
  PendingMutationsContext,
11
142
  PowerSyncContext,
12
- PowerSyncProvider,
13
143
  SyncActivityContext,
14
144
  SyncMetricsContext,
15
145
  SyncModeContext,
16
146
  SyncStatusContext,
17
147
  useAttachmentQueue,
148
+ useAttachmentQueueReady,
149
+ useCompletedTransactions,
18
150
  useCompletedTransactionsContext,
19
151
  useConnectionHealth,
20
152
  useConnectionStatus,
21
153
  useDatabase,
22
154
  useDownloadProgress,
23
155
  useEntitySyncStatus,
156
+ useFailedTransactions,
24
157
  useFailedTransactionsContext,
25
158
  useIsSyncing,
26
159
  useOnlineStatus,
@@ -36,24 +169,32 @@ import {
36
169
  useSyncModeContext,
37
170
  useSyncStatus,
38
171
  useUploadStatus
39
- } from "./chunk-KCDG2MNP.js";
172
+ } from "./chunk-YSTEESEG.js";
173
+ import "./chunk-T4AO7JIG.js";
174
+ import "./chunk-CAB26E6F.js";
40
175
  import {
41
- AttachmentQueue,
42
- AttachmentState,
43
- DEFAULT_CACHE_CONFIG,
44
- DEFAULT_COMPRESSION_CONFIG,
45
- DEFAULT_DOWNLOAD_CONFIG
46
- } from "./chunk-V6LJ6MR2.js";
47
- import "./chunk-5FIMA26D.js";
176
+ CacheSettingsManager,
177
+ DEFAULT_CACHE_SETTINGS,
178
+ createSupabaseStorage,
179
+ isBlobResult,
180
+ isFileResult
181
+ } from "./chunk-XOY2CJ67.js";
48
182
  import {
49
- DEFAULT_CONNECTION_HEALTH,
50
- DEFAULT_SYNC_CONFIG,
51
- DEFAULT_SYNC_METRICS,
52
- DEFAULT_SYNC_STATUS,
53
- HealthMonitor,
54
- MetricsCollector,
55
- SyncStatusTracker
56
- } from "./chunk-R4YFWQ3Q.js";
183
+ SupabaseStorageAdapter,
184
+ createSupabaseStorageAdapter,
185
+ getStorageErrorMessage,
186
+ isStorageAuthError,
187
+ normalizeStoragePath
188
+ } from "./chunk-XAEII4ZX.js";
189
+ import "./chunk-TGBT5XBE.js";
190
+ import {
191
+ SupabaseUploadHandler,
192
+ createSupabaseUploadHandler
193
+ } from "./chunk-P4HZA6ZT.js";
194
+ import {
195
+ DEFAULT_UPLOAD_NOTIFICATION,
196
+ resolveBucket
197
+ } from "./chunk-Z6VOBGTU.js";
57
198
  import "./chunk-W7HSR35B.js";
58
199
  import {
59
200
  ATTACHMENT_DOWNLOAD_TIMEOUT_MS,
@@ -80,37 +221,43 @@ import {
80
221
  STATUS_NOTIFY_THROTTLE_MS,
81
222
  STORAGE_CRITICAL_THRESHOLD,
82
223
  STORAGE_KEY_ATTACHMENT_SETTINGS,
224
+ STORAGE_KEY_AUTO_OFFLINE,
83
225
  STORAGE_KEY_ENABLED,
84
226
  STORAGE_KEY_METRICS,
85
227
  STORAGE_KEY_PAUSED,
86
228
  STORAGE_KEY_PREFIX,
87
229
  STORAGE_KEY_SYNC_MODE,
88
230
  STORAGE_WARNING_THRESHOLD
89
- } from "./chunk-EJ23MXPQ.js";
231
+ } from "./chunk-CGL33PL4.js";
90
232
  import {
91
233
  createNativePlatformAdapter
92
- } from "./chunk-3AYXHQ4W.js";
93
- import "./chunk-VJCL2SWD.js";
234
+ } from "./chunk-WN5ZJ3E2.js";
94
235
  import {
95
- AbortError,
96
- DEFAULT_BACKOFF_CONFIG,
236
+ AuthRefreshError,
237
+ CircuitBreaker,
238
+ CircuitOpenError,
239
+ DEFAULT_CIRCUIT_BREAKER_CONFIG,
240
+ createSupabaseAuth
241
+ } from "./chunk-HWSNV45P.js";
242
+ import {
243
+ ConflictDetectionError,
97
244
  DEFAULT_RETRY_CONFIG,
98
- RetryExhaustedError,
99
245
  SupabaseConnector,
100
- addJitter,
101
- calculateBackoffDelay,
102
246
  defaultSchemaRouter,
103
247
  detectConflicts,
104
248
  fetchServerVersion,
105
249
  getLocalVersion,
106
- hasVersionColumn,
250
+ hasVersionColumn
251
+ } from "./chunk-KN2IZERF.js";
252
+ import {
253
+ AbortError,
254
+ DEFAULT_BACKOFF_CONFIG,
255
+ RetryExhaustedError,
256
+ addJitter,
257
+ calculateBackoffDelay,
107
258
  sleep,
108
259
  withExponentialBackoff
109
- } from "./chunk-62J2DPKX.js";
110
- import {
111
- FailedUploadStore,
112
- failedUploadStore
113
- } from "./chunk-PAFBKNL3.js";
260
+ } from "./chunk-FV2HXEIY.js";
114
261
  import {
115
262
  AttachmentError,
116
263
  ConfigurationError,
@@ -125,29 +272,41 @@ import {
125
272
  extractEntityIds,
126
273
  extractTableNames,
127
274
  generateFailureId,
275
+ isRlsError,
128
276
  toSyncOperationError
129
- } from "./chunk-FPTDATY5.js";
277
+ } from "./chunk-VACPAAQZ.js";
130
278
  export {
131
279
  ATTACHMENT_DOWNLOAD_TIMEOUT_MS,
132
280
  ATTACHMENT_RETRY_DELAY_MS,
281
+ ATTACHMENT_TABLE,
133
282
  AbortError,
283
+ AbstractAttachmentQueue,
134
284
  AttachmentError,
135
- AttachmentQueue,
136
285
  AttachmentQueueContext,
137
286
  AttachmentState,
287
+ AttachmentTable,
288
+ AuthRefreshError,
289
+ CACHE_SIZE_PRESETS,
138
290
  COMPRESSION_MAX_WIDTH,
139
291
  COMPRESSION_SKIP_SIZE_BYTES,
140
292
  COMPRESSION_TARGET_SIZE_BYTES,
293
+ CacheSettingsManager,
294
+ CircuitBreaker,
295
+ CircuitOpenError,
141
296
  CompletedTransactionsContext,
142
297
  ConfigurationError,
143
298
  ConflictBus,
299
+ ConflictDetectionError,
144
300
  ConnectionHealthContext,
145
301
  ConnectionStatusContext,
146
302
  ConnectorError,
147
303
  DEFAULT_ATTACHMENT_CACHE_SIZE,
148
304
  DEFAULT_ATTACHMENT_CONCURRENCY,
305
+ DEFAULT_ATTACHMENT_QUEUE_OPTIONS,
149
306
  DEFAULT_BACKOFF_CONFIG,
150
307
  DEFAULT_CACHE_CONFIG,
308
+ DEFAULT_CACHE_SETTINGS,
309
+ DEFAULT_CIRCUIT_BREAKER_CONFIG,
151
310
  DEFAULT_COMPRESSION_CONFIG,
152
311
  DEFAULT_COMPRESSION_QUALITY,
153
312
  DEFAULT_CONNECTION_HEALTH,
@@ -162,64 +321,170 @@ export {
162
321
  DEFAULT_SYNC_METRICS,
163
322
  DEFAULT_SYNC_MODE,
164
323
  DEFAULT_SYNC_STATUS,
324
+ DEFAULT_UPLOAD_CONFIG,
325
+ DEFAULT_UPLOAD_NOTIFICATION,
165
326
  DOWNLOAD_STOP_THRESHOLD,
327
+ DOWNLOAD_WORKFLOW_STATES,
328
+ DeadLetterQueue,
166
329
  EVICTION_TRIGGER_THRESHOLD,
330
+ EncodingType,
167
331
  FailedTransactionsContext,
168
- FailedUploadStore,
169
332
  HEALTH_CHECK_INTERVAL_MS,
170
333
  HEALTH_CHECK_TIMEOUT_MS,
171
334
  HealthMonitor,
172
335
  InitializationError,
173
336
  LATENCY_DEGRADED_THRESHOLD_MS,
337
+ LOCALLY_AVAILABLE_STATES,
174
338
  MAX_CONSECUTIVE_FAILURES,
175
339
  MetricsCollector,
340
+ OfflineDataProvider,
341
+ PENDING_DOWNLOAD_STATES,
342
+ PROTECTED_UPLOAD_STATES,
176
343
  PendingMutationsContext,
177
344
  PlatformAdapterError,
345
+ PolAttachmentQueue,
346
+ PolAttachmentState,
347
+ PolStorageAdapter,
178
348
  PowerSyncContext,
179
349
  PowerSyncError,
350
+ PowerSyncErrorBoundary,
180
351
  PowerSyncProvider,
352
+ ProviderBridge,
181
353
  RetryExhaustedError,
354
+ STATE_MAPPING,
355
+ STATE_NAMES,
182
356
  STATS_CACHE_TTL_MS,
183
357
  STATUS_NOTIFY_THROTTLE_MS,
184
358
  STORAGE_CRITICAL_THRESHOLD,
185
359
  STORAGE_KEY_ATTACHMENT_SETTINGS,
360
+ STORAGE_KEY_AUTO_OFFLINE,
186
361
  STORAGE_KEY_ENABLED,
187
362
  STORAGE_KEY_METRICS,
188
363
  STORAGE_KEY_PAUSED,
189
364
  STORAGE_KEY_PREFIX,
190
365
  STORAGE_KEY_SYNC_MODE,
191
366
  STORAGE_WARNING_THRESHOLD,
367
+ SlimPowerSyncProvider,
192
368
  SupabaseConnector,
369
+ SupabaseStorageAdapter,
370
+ SupabaseUploadHandler,
193
371
  SyncActivityContext,
194
372
  SyncMetricsContext,
195
373
  SyncModeContext,
196
374
  SyncOperationError,
197
375
  SyncStatusContext,
198
376
  SyncStatusTracker,
377
+ TERMINAL_STATES,
378
+ UPLOAD_WORKFLOW_STATES,
379
+ VALID_STATES,
199
380
  addJitter,
381
+ blobToArrayBuffer,
382
+ buildIdOnlyWatchQuery,
383
+ buildRecordFetchQuery,
384
+ buildWatchQuery,
385
+ cacheLocalFile,
200
386
  calculateBackoffDelay,
387
+ checkIntegrityImpl,
388
+ checkStorageQuotaImpl,
201
389
  classifyError,
202
390
  classifySupabaseError,
391
+ clearCache,
392
+ clearUploadCallback,
393
+ compactDatabaseImpl,
394
+ copyToManagedCache,
395
+ createCacheManagerDeps,
396
+ createDeadLetterEntry,
397
+ createMigrationStats,
203
398
  createNativePlatformAdapter,
399
+ createPolAttachmentQueue,
400
+ createSupabaseAuth,
401
+ createSupabaseStorage,
402
+ createSupabaseStorageAdapter,
403
+ createSupabaseUploadHandler,
204
404
  createSyncError,
405
+ createUploadManagerDeps,
406
+ createUploadManagerState,
205
407
  defaultSchemaRouter,
408
+ defineBackgroundSyncTask,
206
409
  detectConflicts,
410
+ determineAttachmentState,
411
+ downloadRecord,
412
+ enforceCacheLimit,
413
+ ensureFileUri,
207
414
  extractEntityIds,
415
+ extractErrorCode,
208
416
  extractTableNames,
209
- failedUploadStore,
210
417
  fetchServerVersion,
418
+ formatBytes,
419
+ formatCacheSize,
420
+ formatMigrationStats,
421
+ generateDLQEntryId,
211
422
  generateFailureId,
423
+ getCacheStatsImpl,
424
+ getCachedSize,
425
+ getEvictionCandidates,
426
+ getExcludeProtectedStatesCondition,
427
+ getExtensionFromMimeType,
428
+ getFailedPermanentUploads,
429
+ getLocalUriForStoragePath,
212
430
  getLocalVersion,
431
+ getMimeType,
432
+ getMimeTypeFromPath,
433
+ getPendingUploads,
434
+ getProtectedStatesInClause,
435
+ getSoonestRetryTime,
436
+ getStaleUploads,
437
+ getStateName,
438
+ getStorageErrorMessage,
439
+ getSyncedUploadsWithPendingCallback,
213
440
  hasVersionColumn,
441
+ initializeBackgroundSync,
442
+ isAudioMimeType,
443
+ isBackgroundSyncRegistered,
444
+ isBlobResult,
445
+ isCacheNearCapacity,
446
+ isDocumentMimeType,
447
+ isDownloadWorkflowState,
448
+ isFileResult,
449
+ isImageMimeType,
450
+ isLocallyAvailable,
451
+ isPendingDownloadState,
452
+ isPermanentError,
453
+ isProtectedUploadState,
454
+ isRlsError,
455
+ isStateTransitionAllowed,
456
+ isStorageAuthError,
457
+ isTerminalState,
458
+ isUploadWorkflowState,
459
+ isValidAttachmentState,
460
+ isVideoMimeType,
461
+ markUploadPermanentFailure,
462
+ markUploadSynced,
463
+ migrateAttachmentState,
464
+ migrateAttachmentStateSafe,
465
+ normalizeStoragePath,
466
+ recordMigration,
467
+ registerBackgroundSync,
468
+ resolveBucket,
469
+ scheduleUploadRetry,
214
470
  sleep,
471
+ startUploadProcessing,
472
+ stripFileUri,
215
473
  toSyncOperationError,
474
+ unregisterBackgroundSync,
475
+ uploadOne,
216
476
  useAttachmentQueue,
477
+ useAttachmentQueueContext,
478
+ useAttachmentQueueReady,
479
+ useCompletedTransactions,
217
480
  useCompletedTransactionsContext,
218
481
  useConnectionHealth,
219
482
  useConnectionStatus,
220
483
  useDatabase,
484
+ useDatabaseMaintenance,
221
485
  useDownloadProgress,
222
486
  useEntitySyncStatus,
487
+ useFailedTransactions,
223
488
  useFailedTransactionsContext,
224
489
  useIsSyncing,
225
490
  useOnlineStatus,
@@ -227,6 +492,7 @@ export {
227
492
  usePendingMutationsContext,
228
493
  usePlatform,
229
494
  usePowerSync,
495
+ usePowerSyncContext,
230
496
  useSyncActivity,
231
497
  useSyncActivityContext,
232
498
  useSyncControl,
@@ -234,7 +500,12 @@ export {
234
500
  useSyncMode,
235
501
  useSyncModeContext,
236
502
  useSyncStatus,
503
+ useSyncStatusContext,
237
504
  useUploadStatus,
505
+ validateSqlIdentifier2 as validateSqlIdentifier,
506
+ validateSqlIdentifier as validateSqlIdentifierFromStateMachine,
507
+ validateWhereClause,
508
+ watchConfigToSourceConfig,
238
509
  withExponentialBackoff
239
510
  };
240
511
  //# sourceMappingURL=index.native.js.map
@@ -1,14 +1,26 @@
1
- export { A as AbstractPowerSyncDatabase, k as CacheStats, i as ClassifiedError, j as CompactResult, h as CompletedTransaction, b as ConnectionHealth, o as CountRow, C as CrudEntry, l as CrudTransaction, n as DbStatRow, D as DownloadProgress, E as EntitySyncState, F as FailedTransaction, r as FreelistCountRow, s as IntegrityCheckRow, I as IntegrityResult, q as PageCountRow, p as PageSizeRow, P as PowerSyncBackendConnector, m as SqliteTableRow, c as StorageInfo, d as StorageQuota, f as SyncError, g as SyncErrorType, e as SyncMetrics, S as SyncMode, a as SyncStatus, T as TableCacheStats } from './types-afHtE1U_.js';
2
- export { ATTACHMENT_DOWNLOAD_TIMEOUT_MS, ATTACHMENT_RETRY_DELAY_MS, AttachmentError, COMPRESSION_MAX_WIDTH, COMPRESSION_SKIP_SIZE_BYTES, COMPRESSION_TARGET_SIZE_BYTES, ConfigurationError, ConnectorError, DEFAULT_ATTACHMENT_CACHE_SIZE, DEFAULT_ATTACHMENT_CONCURRENCY, DEFAULT_COMPRESSION_QUALITY, DEFAULT_MAX_RETRY_ATTEMPTS, DEFAULT_RETRY_BACKOFF_MULTIPLIER, DEFAULT_RETRY_BASE_DELAY_MS, DEFAULT_RETRY_MAX_DELAY_MS, DEFAULT_SYNC_INTERVAL_MS, DEFAULT_SYNC_MODE, DOWNLOAD_STOP_THRESHOLD, EVICTION_TRIGGER_THRESHOLD, HEALTH_CHECK_INTERVAL_MS, HEALTH_CHECK_TIMEOUT_MS, InitializationError, LATENCY_DEGRADED_THRESHOLD_MS, MAX_CONSECUTIVE_FAILURES, PlatformAdapterError, PowerSyncError, STATS_CACHE_TTL_MS, STATUS_NOTIFY_THROTTLE_MS, STORAGE_CRITICAL_THRESHOLD, STORAGE_KEY_ATTACHMENT_SETTINGS, STORAGE_KEY_ENABLED, STORAGE_KEY_METRICS, STORAGE_KEY_PAUSED, STORAGE_KEY_PREFIX, STORAGE_KEY_SYNC_MODE, STORAGE_WARNING_THRESHOLD, SyncOperationError, classifyError, classifySupabaseError, createSyncError, extractEntityIds, extractTableNames, generateFailureId, toSyncOperationError } from './core/index.js';
3
- export { f as ConflictBus, g as ConflictCheckResult, j as ConflictDetectionConfig, i as ConflictHandler, k as ConflictListener, h as ConflictResolution, C as ConnectorConfig, c as CrudHandler, D as DEFAULT_RETRY_CONFIG, F as FieldConflict, P as PowerSyncCredentials, l as ResolutionListener, e as RetryConfig, R as RetryStrategyConfig, b as SchemaRouter, S as SupabaseConnector, a as SupabaseConnectorOptions, d as defaultSchemaRouter } from './index-l3iL9Jte.js';
4
- export { AttachmentQueue, AttachmentQueueConfig, AttachmentRecord, AttachmentSourceConfig, AttachmentState, AttachmentStatsRow, AttachmentStorageAdapter, AttachmentSyncStats, AttachmentSyncStatus, CacheConfig, CacheFileRow, CachedSizeRow, CompressionConfig, DEFAULT_CACHE_CONFIG, DEFAULT_COMPRESSION_CONFIG, DEFAULT_DOWNLOAD_CONFIG, DownloadConfig, DownloadPhase, DownloadStatus, EvictRow, IdRow } from './attachments/index.js';
5
- export { e as HealthCheckResult, H as HealthMonitorOptions, M as MetricsCollectorOptions, P as PowerSyncRawStatus, c as SyncControlActions, f as SyncEvent, g as SyncEventListener, d as SyncOperationData, S as SyncScope, a as SyncStatusState, b as SyncStatusTrackerOptions, U as Unsubscribe } from './types-Cd7RhNqf.js';
6
- export { HealthMonitor, MetricsCollector, SyncStatusTracker } from './sync/index.js';
7
- export { F as FailedUpload, a as FailedUploadStore, f as failedUploadStore } from './failed-upload-store-C0cLxxPz.js';
8
- export { AbortError, BackoffConfig, BackoffOptions, DEFAULT_BACKOFF_CONFIG, RetryExhaustedError, addJitter, calculateBackoffDelay, detectConflicts, fetchServerVersion, getLocalVersion, hasVersionColumn, sleep, withExponentialBackoff } from './index.js';
9
- export { AttachmentQueueContext, CompletedTransactionsContext, CompletedTransactionsContextValue, ConnectionHealthContext, ConnectionHealthContextValue, ConnectionStatusContext, ConnectionStatusContextValue, DEFAULT_CONNECTION_HEALTH, DEFAULT_SYNC_CONFIG, DEFAULT_SYNC_METRICS, DEFAULT_SYNC_STATUS, EntitySyncStatusResult, FailedTransactionsContext, FailedTransactionsContextValue, PendingMutationsContext, PendingMutationsContextValue, PowerSyncConfig, PowerSyncContext, PowerSyncContextValue, PowerSyncProvider, PowerSyncProviderProps, SyncActivityContext, SyncActivityContextValue, SyncActivityResult, SyncConfig, SyncMetricsContext, SyncMetricsContextValue, SyncModeContext, SyncModeContextValue, SyncStatusContext, SyncStatusContextValue, UploadStatusResult, useAttachmentQueue, useCompletedTransactionsContext, useConnectionHealth, useConnectionStatus, useDatabase, useDownloadProgress, useEntitySyncStatus, useFailedTransactionsContext, useIsSyncing, useOnlineStatus, usePendingMutations, usePendingMutationsContext, usePlatform, usePowerSync, useSyncActivity, useSyncActivityContext, useSyncControl, useSyncMetrics, useSyncMode, useSyncModeContext, useSyncStatus, useUploadStatus } from './provider/index.js';
1
+ export { A as AbstractPowerSyncDatabase, k as CacheStats, i as ClassifiedError, j as CompactResult, h as CompletedTransaction, b as ConnectionHealth, o as CountRow, C as CrudEntry, l as CrudTransaction, n as DbStatRow, D as DownloadProgress, E as EntitySyncState, F as FailedTransaction, r as FreelistCountRow, s as IntegrityCheckRow, I as IntegrityResult, q as PageCountRow, p as PageSizeRow, P as PowerSyncBackendConnector, m as SqliteTableRow, c as StorageInfo, d as StorageQuota, f as SyncError, g as SyncErrorType, e as SyncMetrics, S as SyncMode, a as SyncStatus, T as TableCacheStats } from './types-CDqWh56B.js';
2
+ export { ATTACHMENT_DOWNLOAD_TIMEOUT_MS, ATTACHMENT_RETRY_DELAY_MS, AttachmentError, COMPRESSION_MAX_WIDTH, COMPRESSION_SKIP_SIZE_BYTES, COMPRESSION_TARGET_SIZE_BYTES, ConfigurationError, ConnectorError, DEFAULT_ATTACHMENT_CACHE_SIZE, DEFAULT_ATTACHMENT_CONCURRENCY, DEFAULT_COMPRESSION_QUALITY, DEFAULT_MAX_RETRY_ATTEMPTS, DEFAULT_RETRY_BACKOFF_MULTIPLIER, DEFAULT_RETRY_BASE_DELAY_MS, DEFAULT_RETRY_MAX_DELAY_MS, DEFAULT_SYNC_INTERVAL_MS, DEFAULT_SYNC_MODE, DOWNLOAD_STOP_THRESHOLD, EVICTION_TRIGGER_THRESHOLD, HEALTH_CHECK_INTERVAL_MS, HEALTH_CHECK_TIMEOUT_MS, InitializationError, LATENCY_DEGRADED_THRESHOLD_MS, MAX_CONSECUTIVE_FAILURES, PlatformAdapterError, PowerSyncError, STATS_CACHE_TTL_MS, STATUS_NOTIFY_THROTTLE_MS, STORAGE_CRITICAL_THRESHOLD, STORAGE_KEY_ATTACHMENT_SETTINGS, STORAGE_KEY_AUTO_OFFLINE, STORAGE_KEY_ENABLED, STORAGE_KEY_METRICS, STORAGE_KEY_PAUSED, STORAGE_KEY_PREFIX, STORAGE_KEY_SYNC_MODE, STORAGE_WARNING_THRESHOLD, SyncOperationError, classifyError, classifySupabaseError, createSyncError, extractEntityIds, extractTableNames, generateFailureId, isRlsError, toSyncOperationError } from './core/index.js';
3
+ export { A as AuthProvider, g as ConflictBus, h as ConflictCheckResult, k as ConflictDetectionConfig, j as ConflictHandler, l as ConflictListener, i as ConflictResolution, C as ConnectorCircuitBreakerConfig, a as ConnectorConfig, c as CrudHandler, D as DEFAULT_RETRY_CONFIG, F as FieldConflict, P as PowerSyncCredentials, m as ResolutionListener, e as RetryConfig, R as RetryStrategyConfig, b as SchemaRouter, f as Session, S as SupabaseConnectorOptions, d as defaultSchemaRouter } from './types-B212hgfA.js';
4
+ export { S as SupabaseConnector } from './supabase-connector-T9vHq_3i.js';
5
+ export { AuthRefreshError, CircuitBreaker, CircuitBreakerConfig, CircuitBreakerStats, CircuitOpenError, CircuitState, DEFAULT_CIRCUIT_BREAKER_CONFIG, SupabaseAuthOptions, createSupabaseAuth } from './connector/index.js';
6
+ export { e as AttachmentConfig, z as AttachmentRecord, A as AttachmentSourceConfig, w as AttachmentStatsRow, f as AttachmentStorageAdapter, v as AttachmentSyncStats, u as AttachmentSyncStatus, B as BatchFilterContext, m as CACHE_SIZE_PRESETS, k as CacheConfig, x as CacheFileRow, n as CacheSizePreset, o as CacheSizeValue, y as CachedSizeRow, C as CompressionConfig, l as DEFAULT_CACHE_CONFIG, D as DEFAULT_COMPRESSION_CONFIG, j as DEFAULT_DOWNLOAD_CONFIG, g as DEFAULT_UPLOAD_CONFIG, i as DownloadConfig, q as DownloadPhase, r as DownloadStatus, E as EvictRow, I as IdRow, P as PolAttachmentQueue, a as PolAttachmentQueueOptions, d as PolAttachmentRecord, b as PolAttachmentState, S as SkipDownloadContext, U as UploadConfig, h as UploadHandler, s as UploadPhase, t as UploadStatus, W as WatchConfig, c as createPolAttachmentQueue, p as formatCacheSize } from './pol-attachment-queue-BVAIueoP.js';
7
+ export { CacheManagerDeps, DOWNLOAD_WORKFLOW_STATES, DownloadManagerDeps, LOCALLY_AVAILABLE_STATES, MigrationStats, PENDING_DOWNLOAD_STATES, PROTECTED_UPLOAD_STATES, PolStorageAdapter, PolStorageAdapterOptions, STATE_MAPPING, STATE_NAMES, TERMINAL_STATES, UPLOAD_WORKFLOW_STATES, UploadManagerDeps, UploadManagerState, VALID_STATES, blobToArrayBuffer, buildIdOnlyWatchQuery, buildRecordFetchQuery, buildWatchQuery, cacheLocalFile, clearCache, clearUploadCallback, copyToManagedCache, createCacheManagerDeps, createMigrationStats, createUploadManagerDeps, createUploadManagerState, determineAttachmentState, downloadRecord, enforceCacheLimit, ensureFileUri, extractErrorCode, formatMigrationStats, getCachedSize, getEvictionCandidates, getExcludeProtectedStatesCondition, getFailedPermanentUploads, getLocalUriForStoragePath, getPendingUploads, getProtectedStatesInClause, getSoonestRetryTime, getStaleUploads, getStateName, getSyncedUploadsWithPendingCallback, isCacheNearCapacity, isDownloadWorkflowState, isLocallyAvailable, isPendingDownloadState, isPermanentError, isProtectedUploadState, isStateTransitionAllowed, isTerminalState, isUploadWorkflowState, isValidAttachmentState, markUploadPermanentFailure, markUploadSynced, migrateAttachmentState, migrateAttachmentStateSafe, recordMigration, scheduleUploadRetry, startUploadProcessing, stripFileUri, uploadOne, validateSqlIdentifier, validateSqlIdentifierFromStateMachine, validateWhereClause, watchConfigToSourceConfig } from './attachments/index.js';
8
+ export { B as BackgroundSyncOptions, h as BackgroundSyncSystem, e as HealthCheckResult, H as HealthMonitorOptions, M as MetricsCollectorOptions, P as PowerSyncRawStatus, c as SyncControlActions, f as SyncEvent, g as SyncEventListener, d as SyncOperationData, S as SyncScope, a as SyncStatusState, b as SyncStatusTrackerOptions, U as Unsubscribe, i as defineBackgroundSyncTask, j as initializeBackgroundSync, k as isBackgroundSyncRegistered, r as registerBackgroundSync, u as unregisterBackgroundSync } from './background-sync-ChCXW-EV.js';
9
+ export { DeadLetterEntry, DeadLetterQueue, DeadLetterQueueListener, DeadLetterQueueOptions, DeadLetterReason, HealthMonitor, MetricsCollector, SyncStatusTracker, createDeadLetterEntry, generateDLQEntryId } from './sync/index.js';
10
+ export { AbortError, BackoffConfig, BackoffOptions, ConflictDetectionError, DEFAULT_BACKOFF_CONFIG, RetryExhaustedError, addJitter, calculateBackoffDelay, detectConflicts, fetchServerVersion, formatBytes, getExtensionFromMimeType, getLocalVersion, getMimeType, getMimeTypeFromPath, hasVersionColumn, isAudioMimeType, isDocumentMimeType, isImageMimeType, isVideoMimeType, sleep, withExponentialBackoff } from './index.js';
11
+ export { DatabaseMaintenanceUtils, checkIntegrityImpl, checkStorageQuotaImpl, compactDatabaseImpl, getCacheStatsImpl, useDatabaseMaintenance } from './maintenance/index.js';
12
+ export { D as DownloadResult, a as StorageBackend, b as StorageUploadOptions, d as SupabaseClient, S as SupabaseStorage, c as SupabaseStorageOptions, e as SupabaseTransformOptions, U as UploadProgress, r as resolveBucket } from './types-D0WcHrq6.js';
13
+ export { f as CacheSettings, C as CacheSettingsManager, h as CacheSettingsManagerOptions, D as DEFAULT_CACHE_SETTINGS, I as ImageTransformOptions, S as SupabaseStorageAdapter, e as SupabaseStorageAdapterOptions, c as createSupabaseStorage, d as createSupabaseStorageAdapter, g as getStorageErrorMessage, a as isBlobResult, i as isFileResult, b as isStorageAuthError, n as normalizeStoragePath } from './CacheSettingsManager-uz-kbnRH.js';
14
+ export { D as DEFAULT_UPLOAD_NOTIFICATION, S as SupabaseUploadHandlerOptions, U as UploadEventHandlers, a as UploadNotificationConfig } from './types-CyvBaAl8.js';
15
+ export { SupabaseUploadHandler, createSupabaseUploadHandler } from './storage/upload/index.js';
16
+ export { PowerSyncErrorBoundary } from './error/index.js';
17
+ export { AttachmentQueueContext, BackgroundSyncCallbacks, BackgroundSyncConfig, BackgroundSyncStatus, CompletedTransactionsContext, CompletedTransactionsContextValue, ConnectionHealthContext, ConnectionHealthContextValue, ConnectionStatusContext, ConnectionStatusContextValue, DEFAULT_CONNECTION_HEALTH, DEFAULT_SYNC_CONFIG, DEFAULT_SYNC_METRICS, DEFAULT_SYNC_STATUS, DataLayerConfig, DataLayerIntegration, EntitySyncStatusResult, FailedTransactionsContext, FailedTransactionsContextValue, OfflineDataAttachmentConfig, OfflineDataProvider, OfflineDataProviderConfig, OfflineDataProviderProps, PendingMutationsContext, PendingMutationsContextValue, PowerSyncConfig, PowerSyncContext, PowerSyncContextValue, PowerSyncProvider, PowerSyncProviderProps, PowerSyncSyncStatusSnapshot, ProviderBridge, ProviderBridgeProps, SyncActivityContext, SyncActivityContextValue, SyncActivityResult, SyncConfig, SyncMetricsContext, SyncMetricsContextValue, SyncModeContext, SyncModeContextValue, SyncStatusContext, SyncStatusContextValue, UploadStatusResult, useAttachmentQueue, useAttachmentQueueReady, useCompletedTransactions, useCompletedTransactionsContext, useConnectionHealth, useConnectionStatus, useDatabase, useDownloadProgress, useEntitySyncStatus, useFailedTransactions, useFailedTransactionsContext, useIsSyncing, useOnlineStatus, usePendingMutations, usePendingMutationsContext, usePlatform, usePowerSync, useSyncActivity, useSyncActivityContext, useSyncControl, useSyncMetrics, useSyncMode, useSyncModeContext, useSyncStatus, useUploadStatus } from './provider/index.js';
18
+ export { AttachmentQueueContextValue, SlimPowerSyncProvider, useAttachmentQueueContext, usePowerSyncContext, useSyncStatusContext } from './react/index.js';
10
19
  export { AsyncStorageAdapter, CompressedImage, CompressionOptions, ConnectionType, DatabaseOptions, FileInfo, FileSystemAdapter, ImageProcessorAdapter, LoggerAdapter, NetworkAdapter, PlatformAdapter, PlatformType, detectPlatform } from './platform/index.js';
11
20
  export { createWebPlatformAdapter } from './platform/index.web.js';
21
+ export { ATTACHMENT_TABLE, AbstractAttachmentQueue, AttachmentState, AttachmentTable, AttachmentTableOptions, AttachmentQueueOptions as BaseAttachmentQueueOptions, DEFAULT_ATTACHMENT_QUEUE_OPTIONS, EncodingType, AttachmentRecord as OfficialAttachmentRecord, StorageAdapter } from '@powersync/attachments';
22
+ export { AbstractPowerSyncDatabase as PowerSyncDBInterface } from '@powersync/common';
12
23
  import '@supabase/supabase-js';
13
- import '@tanstack/react-query';
14
24
  import 'react';
25
+ import '@tanstack/react-query';
26
+ import '@powersync/react-native';