@pol-studios/powersync 1.0.4 → 1.0.7

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 (115) hide show
  1. package/dist/CacheSettingsManager-1exbOC6S.d.ts +261 -0
  2. package/dist/attachments/index.d.ts +65 -355
  3. package/dist/attachments/index.js +24 -6
  4. package/dist/{types-Cd7RhNqf.d.ts → background-sync-ChCXW-EV.d.ts} +53 -2
  5. package/dist/chunk-4C3RY5SU.js +204 -0
  6. package/dist/chunk-4C3RY5SU.js.map +1 -0
  7. package/dist/{chunk-3AYXHQ4W.js → chunk-53WH2JJV.js} +111 -47
  8. package/dist/chunk-53WH2JJV.js.map +1 -0
  9. package/dist/chunk-A4IBBWGO.js +377 -0
  10. package/dist/chunk-A4IBBWGO.js.map +1 -0
  11. package/dist/chunk-BREGB4WL.js +1768 -0
  12. package/dist/chunk-BREGB4WL.js.map +1 -0
  13. package/dist/{chunk-EJ23MXPQ.js → chunk-CGL33PL4.js} +3 -1
  14. package/dist/chunk-CGL33PL4.js.map +1 -0
  15. package/dist/chunk-DGUM43GV.js +11 -0
  16. package/dist/chunk-DHYUBVP7.js +131 -0
  17. package/dist/chunk-DHYUBVP7.js.map +1 -0
  18. package/dist/chunk-FV2HXEIY.js +124 -0
  19. package/dist/chunk-FV2HXEIY.js.map +1 -0
  20. package/dist/chunk-GKF7TOMT.js +1 -0
  21. package/dist/{chunk-OTJXIRWX.js → chunk-H772V6XQ.js} +304 -51
  22. package/dist/chunk-H772V6XQ.js.map +1 -0
  23. package/dist/{chunk-C2RSTGDC.js → chunk-HFOFLW5F.js} +525 -87
  24. package/dist/chunk-HFOFLW5F.js.map +1 -0
  25. package/dist/chunk-KGSFAE5B.js +1 -0
  26. package/dist/chunk-LNL64IJZ.js +1 -0
  27. package/dist/chunk-MKD2VCX3.js +32 -0
  28. package/dist/chunk-MKD2VCX3.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-P6WOZO7H.js +49 -0
  32. package/dist/chunk-P6WOZO7H.js.map +1 -0
  33. package/dist/chunk-TGBT5XBE.js +1 -0
  34. package/dist/chunk-TGBT5XBE.js.map +1 -0
  35. package/dist/chunk-UEYRTLKE.js +72 -0
  36. package/dist/chunk-UEYRTLKE.js.map +1 -0
  37. package/dist/chunk-WGHNIAF7.js +329 -0
  38. package/dist/chunk-WGHNIAF7.js.map +1 -0
  39. package/dist/chunk-WQ5MPAVC.js +449 -0
  40. package/dist/chunk-WQ5MPAVC.js.map +1 -0
  41. package/dist/{chunk-FPTDATY5.js → chunk-XQAJM2MW.js} +22 -11
  42. package/dist/chunk-XQAJM2MW.js.map +1 -0
  43. package/dist/chunk-YSTEESEG.js +676 -0
  44. package/dist/chunk-YSTEESEG.js.map +1 -0
  45. package/dist/chunk-ZEOKPWUC.js +1165 -0
  46. package/dist/chunk-ZEOKPWUC.js.map +1 -0
  47. package/dist/connector/index.d.ts +182 -2
  48. package/dist/connector/index.js +14 -3
  49. package/dist/core/index.d.ts +5 -3
  50. package/dist/core/index.js +5 -2
  51. package/dist/error/index.d.ts +54 -0
  52. package/dist/error/index.js +8 -0
  53. package/dist/error/index.js.map +1 -0
  54. package/dist/index.d.ts +237 -11
  55. package/dist/index.js +183 -27
  56. package/dist/index.native.d.ts +20 -9
  57. package/dist/index.native.js +183 -28
  58. package/dist/index.web.d.ts +20 -9
  59. package/dist/index.web.js +184 -28
  60. package/dist/maintenance/index.d.ts +118 -0
  61. package/dist/maintenance/index.js +17 -0
  62. package/dist/maintenance/index.js.map +1 -0
  63. package/dist/platform/index.d.ts +16 -1
  64. package/dist/platform/index.js +2 -0
  65. package/dist/platform/index.js.map +1 -1
  66. package/dist/platform/index.native.d.ts +2 -2
  67. package/dist/platform/index.native.js +2 -1
  68. package/dist/platform/index.web.d.ts +1 -1
  69. package/dist/platform/index.web.js +2 -1
  70. package/dist/pol-attachment-queue-C7YNXXhK.d.ts +676 -0
  71. package/dist/provider/index.d.ts +693 -12
  72. package/dist/provider/index.js +57 -12
  73. package/dist/storage/index.d.ts +6 -0
  74. package/dist/storage/index.js +28 -0
  75. package/dist/storage/index.js.map +1 -0
  76. package/dist/storage/index.native.d.ts +6 -0
  77. package/dist/storage/index.native.js +26 -0
  78. package/dist/storage/index.native.js.map +1 -0
  79. package/dist/storage/index.web.d.ts +6 -0
  80. package/dist/storage/index.web.js +26 -0
  81. package/dist/storage/index.web.js.map +1 -0
  82. package/dist/storage/upload/index.d.ts +55 -0
  83. package/dist/storage/upload/index.js +15 -0
  84. package/dist/storage/upload/index.js.map +1 -0
  85. package/dist/storage/upload/index.native.d.ts +57 -0
  86. package/dist/storage/upload/index.native.js +14 -0
  87. package/dist/storage/upload/index.native.js.map +1 -0
  88. package/dist/storage/upload/index.web.d.ts +5 -0
  89. package/dist/storage/upload/index.web.js +14 -0
  90. package/dist/storage/upload/index.web.js.map +1 -0
  91. package/dist/{index-Cb-NI0Ct.d.ts → supabase-connector-qLm-WHkM.d.ts} +146 -10
  92. package/dist/sync/index.d.ts +288 -22
  93. package/dist/sync/index.js +23 -5
  94. package/dist/types-BVacP54t.d.ts +52 -0
  95. package/dist/types-Bgvx7-E8.d.ts +187 -0
  96. package/dist/{types-afHtE1U_.d.ts → types-CDqWh56B.d.ts} +2 -0
  97. package/package.json +72 -2
  98. package/dist/chunk-32OLICZO.js +0 -1
  99. package/dist/chunk-3AYXHQ4W.js.map +0 -1
  100. package/dist/chunk-7EMDVIZX.js.map +0 -1
  101. package/dist/chunk-7JQZBZ5N.js +0 -1
  102. package/dist/chunk-C2RSTGDC.js.map +0 -1
  103. package/dist/chunk-EJ23MXPQ.js.map +0 -1
  104. package/dist/chunk-FPTDATY5.js.map +0 -1
  105. package/dist/chunk-GMFDCVMZ.js +0 -1285
  106. package/dist/chunk-GMFDCVMZ.js.map +0 -1
  107. package/dist/chunk-OLHGI472.js +0 -1
  108. package/dist/chunk-OTJXIRWX.js.map +0 -1
  109. package/dist/chunk-V6LJ6MR2.js +0 -740
  110. package/dist/chunk-V6LJ6MR2.js.map +0 -1
  111. package/dist/chunk-VJCL2SWD.js +0 -1
  112. /package/dist/{chunk-32OLICZO.js.map → chunk-DGUM43GV.js.map} +0 -0
  113. /package/dist/{chunk-7JQZBZ5N.js.map → chunk-GKF7TOMT.js.map} +0 -0
  114. /package/dist/{chunk-OLHGI472.js.map → chunk-KGSFAE5B.js.map} +0 -0
  115. /package/dist/{chunk-VJCL2SWD.js.map → chunk-LNL64IJZ.js.map} +0 -0
@@ -1,62 +1,107 @@
1
+ import {
2
+ OfflineDataProvider,
3
+ PowerSyncProvider,
4
+ ProviderBridge
5
+ } from "../chunk-BREGB4WL.js";
6
+ import "../chunk-P6WOZO7H.js";
7
+ import "../chunk-ZEOKPWUC.js";
8
+ import {
9
+ DEFAULT_CONNECTION_HEALTH,
10
+ DEFAULT_SYNC_CONFIG,
11
+ DEFAULT_SYNC_METRICS,
12
+ DEFAULT_SYNC_STATUS
13
+ } from "../chunk-H772V6XQ.js";
1
14
  import {
2
15
  AttachmentQueueContext,
16
+ CompletedTransactionsContext,
3
17
  ConnectionHealthContext,
18
+ ConnectionStatusContext,
19
+ FailedTransactionsContext,
20
+ PendingMutationsContext,
4
21
  PowerSyncContext,
5
- PowerSyncProvider,
22
+ SyncActivityContext,
6
23
  SyncMetricsContext,
24
+ SyncModeContext,
7
25
  SyncStatusContext,
8
26
  useAttachmentQueue,
27
+ useAttachmentQueueReady,
28
+ useCompletedTransactions,
29
+ useCompletedTransactionsContext,
9
30
  useConnectionHealth,
31
+ useConnectionStatus,
10
32
  useDatabase,
11
33
  useDownloadProgress,
12
34
  useEntitySyncStatus,
35
+ useFailedTransactions,
36
+ useFailedTransactionsContext,
13
37
  useIsSyncing,
14
38
  useOnlineStatus,
15
39
  usePendingMutations,
40
+ usePendingMutationsContext,
16
41
  usePlatform,
17
42
  usePowerSync,
18
43
  useSyncActivity,
44
+ useSyncActivityContext,
19
45
  useSyncControl,
20
46
  useSyncMetrics,
21
47
  useSyncMode,
48
+ useSyncModeContext,
22
49
  useSyncStatus,
23
50
  useUploadStatus
24
- } from "../chunk-GMFDCVMZ.js";
25
- import "../chunk-V6LJ6MR2.js";
26
- import {
27
- DEFAULT_CONNECTION_HEALTH,
28
- DEFAULT_SYNC_CONFIG,
29
- DEFAULT_SYNC_METRICS,
30
- DEFAULT_SYNC_STATUS
31
- } from "../chunk-OTJXIRWX.js";
32
- import "../chunk-EJ23MXPQ.js";
33
- import "../chunk-C2RSTGDC.js";
34
- import "../chunk-FPTDATY5.js";
51
+ } from "../chunk-YSTEESEG.js";
52
+ import "../chunk-LNL64IJZ.js";
53
+ import "../chunk-WQ5MPAVC.js";
54
+ import "../chunk-TGBT5XBE.js";
55
+ import "../chunk-UEYRTLKE.js";
56
+ import "../chunk-MKD2VCX3.js";
57
+ import "../chunk-CGL33PL4.js";
58
+ import "../chunk-53WH2JJV.js";
59
+ import "../chunk-HFOFLW5F.js";
60
+ import "../chunk-FV2HXEIY.js";
61
+ import "../chunk-XQAJM2MW.js";
62
+ import "../chunk-DGUM43GV.js";
35
63
  export {
36
64
  AttachmentQueueContext,
65
+ CompletedTransactionsContext,
37
66
  ConnectionHealthContext,
67
+ ConnectionStatusContext,
38
68
  DEFAULT_CONNECTION_HEALTH,
39
69
  DEFAULT_SYNC_CONFIG,
40
70
  DEFAULT_SYNC_METRICS,
41
71
  DEFAULT_SYNC_STATUS,
72
+ FailedTransactionsContext,
73
+ OfflineDataProvider,
74
+ PendingMutationsContext,
42
75
  PowerSyncContext,
43
76
  PowerSyncProvider,
77
+ ProviderBridge,
78
+ SyncActivityContext,
44
79
  SyncMetricsContext,
80
+ SyncModeContext,
45
81
  SyncStatusContext,
46
82
  useAttachmentQueue,
83
+ useAttachmentQueueReady,
84
+ useCompletedTransactions,
85
+ useCompletedTransactionsContext,
47
86
  useConnectionHealth,
87
+ useConnectionStatus,
48
88
  useDatabase,
49
89
  useDownloadProgress,
50
90
  useEntitySyncStatus,
91
+ useFailedTransactions,
92
+ useFailedTransactionsContext,
51
93
  useIsSyncing,
52
94
  useOnlineStatus,
53
95
  usePendingMutations,
96
+ usePendingMutationsContext,
54
97
  usePlatform,
55
98
  usePowerSync,
56
99
  useSyncActivity,
100
+ useSyncActivityContext,
57
101
  useSyncControl,
58
102
  useSyncMetrics,
59
103
  useSyncMode,
104
+ useSyncModeContext,
60
105
  useSyncStatus,
61
106
  useUploadStatus
62
107
  };
@@ -0,0 +1,6 @@
1
+ export { A as AttachmentUploadHandler, a as BucketConfig, B as BucketResolver, D as DownloadResult, P as PowerSyncStorageAdapter, R as RemoteStorageAdapter, S as StorageUploadHandler, b as SupabaseStorageAdapterOptions, U as UploadOptions, r as resolveBucketFromConfig } from '../types-Bgvx7-E8.js';
2
+ export { a as CacheSettings, C as CacheSettingsManager, b as CacheSettingsManagerOptions, D as DEFAULT_CACHE_SETTINGS, S as SupabaseStorageAdapter, c as createSupabaseStorageAdapter } from '../CacheSettingsManager-1exbOC6S.js';
3
+ export { D as DEFAULT_UPLOAD_NOTIFICATION, S as SupabaseUploadHandlerOptions, U as UploadEventHandlers, a as UploadNotificationConfig } from '../types-BVacP54t.js';
4
+ export { SupabaseUploadHandler, createSupabaseUploadHandler } from './upload/index.js';
5
+ import '../platform/index.js';
6
+ import '../types-CDqWh56B.js';
@@ -0,0 +1,28 @@
1
+ import "../chunk-LNL64IJZ.js";
2
+ import {
3
+ CacheSettingsManager,
4
+ DEFAULT_CACHE_SETTINGS,
5
+ SupabaseStorageAdapter,
6
+ createSupabaseStorageAdapter
7
+ } from "../chunk-WQ5MPAVC.js";
8
+ import "../chunk-TGBT5XBE.js";
9
+ import {
10
+ SupabaseUploadHandler,
11
+ createSupabaseUploadHandler
12
+ } from "../chunk-UEYRTLKE.js";
13
+ import {
14
+ DEFAULT_UPLOAD_NOTIFICATION,
15
+ resolveBucketFromConfig
16
+ } from "../chunk-MKD2VCX3.js";
17
+ import "../chunk-DGUM43GV.js";
18
+ export {
19
+ CacheSettingsManager,
20
+ DEFAULT_CACHE_SETTINGS,
21
+ DEFAULT_UPLOAD_NOTIFICATION,
22
+ SupabaseStorageAdapter,
23
+ SupabaseUploadHandler,
24
+ createSupabaseStorageAdapter,
25
+ createSupabaseUploadHandler,
26
+ resolveBucketFromConfig
27
+ };
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,6 @@
1
+ export { A as AttachmentUploadHandler, a as BucketConfig, B as BucketResolver, D as DownloadResult, P as PowerSyncStorageAdapter, R as RemoteStorageAdapter, S as StorageUploadHandler, b as SupabaseStorageAdapterOptions, U as UploadOptions, r as resolveBucketFromConfig } from '../types-Bgvx7-E8.js';
2
+ export { a as CacheSettings, C as CacheSettingsManager, b as CacheSettingsManagerOptions, D as DEFAULT_CACHE_SETTINGS, S as SupabaseStorageAdapter, c as createSupabaseStorageAdapter } from '../CacheSettingsManager-1exbOC6S.js';
3
+ export { D as DEFAULT_UPLOAD_NOTIFICATION, S as SupabaseUploadHandlerOptions, U as UploadEventHandlers, a as UploadNotificationConfig } from '../types-BVacP54t.js';
4
+ export { SupabaseUploadHandler, createSupabaseUploadHandler } from './upload/index.native.js';
5
+ import '../platform/index.js';
6
+ import '../types-CDqWh56B.js';
@@ -0,0 +1,26 @@
1
+ import {
2
+ SupabaseUploadHandler,
3
+ createSupabaseUploadHandler
4
+ } from "../chunk-DHYUBVP7.js";
5
+ import {
6
+ CacheSettingsManager,
7
+ DEFAULT_CACHE_SETTINGS,
8
+ SupabaseStorageAdapter,
9
+ createSupabaseStorageAdapter
10
+ } from "../chunk-WQ5MPAVC.js";
11
+ import {
12
+ DEFAULT_UPLOAD_NOTIFICATION,
13
+ resolveBucketFromConfig
14
+ } from "../chunk-MKD2VCX3.js";
15
+ import "../chunk-DGUM43GV.js";
16
+ export {
17
+ CacheSettingsManager,
18
+ DEFAULT_CACHE_SETTINGS,
19
+ DEFAULT_UPLOAD_NOTIFICATION,
20
+ SupabaseStorageAdapter,
21
+ SupabaseUploadHandler,
22
+ createSupabaseStorageAdapter,
23
+ createSupabaseUploadHandler,
24
+ resolveBucketFromConfig
25
+ };
26
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,6 @@
1
+ export { A as AttachmentUploadHandler, a as BucketConfig, B as BucketResolver, D as DownloadResult, P as PowerSyncStorageAdapter, R as RemoteStorageAdapter, S as StorageUploadHandler, b as SupabaseStorageAdapterOptions, U as UploadOptions, r as resolveBucketFromConfig } from '../types-Bgvx7-E8.js';
2
+ export { a as CacheSettings, C as CacheSettingsManager, b as CacheSettingsManagerOptions, D as DEFAULT_CACHE_SETTINGS, S as SupabaseStorageAdapter, c as createSupabaseStorageAdapter } from '../CacheSettingsManager-1exbOC6S.js';
3
+ export { D as DEFAULT_UPLOAD_NOTIFICATION, S as SupabaseUploadHandlerOptions, U as UploadEventHandlers, a as UploadNotificationConfig } from '../types-BVacP54t.js';
4
+ export { SupabaseUploadHandler, createSupabaseUploadHandler } from './upload/index.js';
5
+ import '../platform/index.js';
6
+ import '../types-CDqWh56B.js';
@@ -0,0 +1,26 @@
1
+ import {
2
+ CacheSettingsManager,
3
+ DEFAULT_CACHE_SETTINGS,
4
+ SupabaseStorageAdapter,
5
+ createSupabaseStorageAdapter
6
+ } from "../chunk-WQ5MPAVC.js";
7
+ import {
8
+ SupabaseUploadHandler,
9
+ createSupabaseUploadHandler
10
+ } from "../chunk-UEYRTLKE.js";
11
+ import {
12
+ DEFAULT_UPLOAD_NOTIFICATION,
13
+ resolveBucketFromConfig
14
+ } from "../chunk-MKD2VCX3.js";
15
+ import "../chunk-DGUM43GV.js";
16
+ export {
17
+ CacheSettingsManager,
18
+ DEFAULT_CACHE_SETTINGS,
19
+ DEFAULT_UPLOAD_NOTIFICATION,
20
+ SupabaseStorageAdapter,
21
+ SupabaseUploadHandler,
22
+ createSupabaseStorageAdapter,
23
+ createSupabaseUploadHandler,
24
+ resolveBucketFromConfig
25
+ };
26
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,55 @@
1
+ import { S as SupabaseUploadHandlerOptions } from '../../types-BVacP54t.js';
2
+ export { D as DEFAULT_UPLOAD_NOTIFICATION, U as UploadEventHandlers, a as UploadNotificationConfig } from '../../types-BVacP54t.js';
3
+ import { S as StorageUploadHandler, a as BucketConfig } from '../../types-Bgvx7-E8.js';
4
+ import '../../platform/index.js';
5
+ import '../../types-CDqWh56B.js';
6
+
7
+ /**
8
+ * Supabase Upload Handler for Web
9
+ *
10
+ * Implements UploadHandler interface using the fetch API
11
+ * for browser-based uploads.
12
+ */
13
+
14
+ /**
15
+ * Web upload handler using the fetch API.
16
+ *
17
+ * Features:
18
+ * - Signed URL-based uploads
19
+ * - AbortSignal cancellation support
20
+ * - Blob/File upload support
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const handler = createSupabaseUploadHandler(supabaseClient, {
25
+ * defaultBucket: 'attachments',
26
+ * bucketMap: new Map([['avatars/', 'user-avatars']]),
27
+ * });
28
+ *
29
+ * await handler.uploadFile(
30
+ * 'photos/image.jpg',
31
+ * blobUrl,
32
+ * 'image/jpeg'
33
+ * );
34
+ * ```
35
+ */
36
+ declare class SupabaseUploadHandler implements StorageUploadHandler {
37
+ private supabase;
38
+ private bucketConfig;
39
+ constructor(options: SupabaseUploadHandlerOptions);
40
+ /**
41
+ * Upload a file to Supabase Storage using fetch.
42
+ * Supports AbortSignal for cancellation.
43
+ */
44
+ uploadFile(storagePath: string, localFileUri: string, mediaType: string, signal?: AbortSignal): Promise<void>;
45
+ /**
46
+ * Resolve the storage bucket for a given path.
47
+ */
48
+ resolveBucket(storagePath: string): string;
49
+ }
50
+ /**
51
+ * Factory function for creating a SupabaseUploadHandler.
52
+ */
53
+ declare function createSupabaseUploadHandler(supabaseClient: any, bucketConfig: BucketConfig): SupabaseUploadHandler;
54
+
55
+ export { SupabaseUploadHandler, SupabaseUploadHandlerOptions, createSupabaseUploadHandler };
@@ -0,0 +1,15 @@
1
+ import "../../chunk-TGBT5XBE.js";
2
+ import {
3
+ SupabaseUploadHandler,
4
+ createSupabaseUploadHandler
5
+ } from "../../chunk-UEYRTLKE.js";
6
+ import {
7
+ DEFAULT_UPLOAD_NOTIFICATION
8
+ } from "../../chunk-MKD2VCX3.js";
9
+ import "../../chunk-DGUM43GV.js";
10
+ export {
11
+ DEFAULT_UPLOAD_NOTIFICATION,
12
+ SupabaseUploadHandler,
13
+ createSupabaseUploadHandler
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,57 @@
1
+ import { S as SupabaseUploadHandlerOptions, a as UploadNotificationConfig } from '../../types-BVacP54t.js';
2
+ export { D as DEFAULT_UPLOAD_NOTIFICATION, U as UploadEventHandlers } from '../../types-BVacP54t.js';
3
+ import { S as StorageUploadHandler, a as BucketConfig } from '../../types-Bgvx7-E8.js';
4
+ import '../../platform/index.js';
5
+ import '../../types-CDqWh56B.js';
6
+
7
+ /**
8
+ * Supabase Upload Handler for React Native
9
+ *
10
+ * Implements UploadHandler interface using react-native-background-upload
11
+ * for iOS background upload capability.
12
+ */
13
+
14
+ /**
15
+ * React Native upload handler using react-native-background-upload.
16
+ *
17
+ * Features:
18
+ * - iOS background upload support
19
+ * - AbortSignal cancellation support
20
+ * - Android notification support
21
+ * - Signed URL-based uploads
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * const handler = createSupabaseUploadHandler(supabaseClient, {
26
+ * defaultBucket: 'attachments',
27
+ * bucketMap: new Map([['avatars/', 'user-avatars']]),
28
+ * });
29
+ *
30
+ * await handler.uploadFile(
31
+ * 'photos/image.jpg',
32
+ * 'file:///path/to/image.jpg',
33
+ * 'image/jpeg'
34
+ * );
35
+ * ```
36
+ */
37
+ declare class SupabaseUploadHandler implements StorageUploadHandler {
38
+ private supabase;
39
+ private bucketConfig;
40
+ private notificationConfig;
41
+ constructor(options: SupabaseUploadHandlerOptions, notificationConfig?: Partial<UploadNotificationConfig>);
42
+ /**
43
+ * Upload a file to Supabase Storage using react-native-background-upload.
44
+ * Supports iOS background uploads and AbortSignal for cancellation.
45
+ */
46
+ uploadFile(storagePath: string, localFileUri: string, mediaType: string, signal?: AbortSignal): Promise<void>;
47
+ /**
48
+ * Resolve the storage bucket for a given path.
49
+ */
50
+ resolveBucket(storagePath: string): string;
51
+ }
52
+ /**
53
+ * Factory function for creating a SupabaseUploadHandler.
54
+ */
55
+ declare function createSupabaseUploadHandler(supabaseClient: any, bucketConfig: BucketConfig, notificationConfig?: Partial<UploadNotificationConfig>): SupabaseUploadHandler;
56
+
57
+ export { SupabaseUploadHandler, SupabaseUploadHandlerOptions, UploadNotificationConfig, createSupabaseUploadHandler };
@@ -0,0 +1,14 @@
1
+ import {
2
+ SupabaseUploadHandler,
3
+ createSupabaseUploadHandler
4
+ } from "../../chunk-DHYUBVP7.js";
5
+ import {
6
+ DEFAULT_UPLOAD_NOTIFICATION
7
+ } from "../../chunk-MKD2VCX3.js";
8
+ import "../../chunk-DGUM43GV.js";
9
+ export {
10
+ DEFAULT_UPLOAD_NOTIFICATION,
11
+ SupabaseUploadHandler,
12
+ createSupabaseUploadHandler
13
+ };
14
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,5 @@
1
+ export { D as DEFAULT_UPLOAD_NOTIFICATION, S as SupabaseUploadHandlerOptions, U as UploadEventHandlers, a as UploadNotificationConfig } from '../../types-BVacP54t.js';
2
+ export { SupabaseUploadHandler, createSupabaseUploadHandler } from './index.js';
3
+ import '../../types-Bgvx7-E8.js';
4
+ import '../../platform/index.js';
5
+ import '../../types-CDqWh56B.js';
@@ -0,0 +1,14 @@
1
+ import {
2
+ SupabaseUploadHandler,
3
+ createSupabaseUploadHandler
4
+ } from "../../chunk-UEYRTLKE.js";
5
+ import {
6
+ DEFAULT_UPLOAD_NOTIFICATION
7
+ } from "../../chunk-MKD2VCX3.js";
8
+ import "../../chunk-DGUM43GV.js";
9
+ export {
10
+ DEFAULT_UPLOAD_NOTIFICATION,
11
+ SupabaseUploadHandler,
12
+ createSupabaseUploadHandler
13
+ };
14
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,5 +1,5 @@
1
+ import { C as CrudEntry, i as ClassifiedError, P as PowerSyncBackendConnector, A as AbstractPowerSyncDatabase } from './types-CDqWh56B.js';
1
2
  import { SupabaseClient } from '@supabase/supabase-js';
2
- import { C as CrudEntry, i as ClassifiedError, P as PowerSyncBackendConnector, A as AbstractPowerSyncDatabase } from './types-afHtE1U_.js';
3
3
  import { LoggerAdapter } from './platform/index.js';
4
4
 
5
5
  /**
@@ -85,10 +85,13 @@ type ResolutionListener = (table: string, recordId: string, resolution: Conflict
85
85
  * 4. Connector subscribes via bus.onResolution() -> triggers re-upload
86
86
  */
87
87
  declare class ConflictBus {
88
+ private static MAX_PENDING;
88
89
  private conflictListeners;
89
90
  private resolutionListeners;
91
+ private pendingConflicts;
90
92
  /**
91
93
  * Subscribe to conflict detection events.
94
+ * Flushes any pending conflicts to ALL listeners (including the new one).
92
95
  * @returns Unsubscribe function
93
96
  */
94
97
  onConflict(listener: ConflictListener): () => void;
@@ -99,6 +102,7 @@ declare class ConflictBus {
99
102
  onResolution(listener: ResolutionListener): () => void;
100
103
  /**
101
104
  * Emit a conflict detection event (called by connector).
105
+ * If no listeners are subscribed, queues the conflict for later delivery.
102
106
  */
103
107
  emitConflict(conflict: ConflictCheckResult): void;
104
108
  /**
@@ -106,9 +110,13 @@ declare class ConflictBus {
106
110
  */
107
111
  emitResolution(table: string, recordId: string, resolution: ConflictResolution): void;
108
112
  /**
109
- * Clear all listeners (for cleanup).
113
+ * Clear all listeners and pending conflicts (for cleanup).
110
114
  */
111
115
  destroy(): void;
116
+ /**
117
+ * Get the number of pending conflicts (useful for debugging/testing).
118
+ */
119
+ get pendingCount(): number;
112
120
  }
113
121
 
114
122
  /**
@@ -117,6 +125,37 @@ declare class ConflictBus {
117
125
  * Defines interfaces for PowerSync backend connectors.
118
126
  */
119
127
 
128
+ /**
129
+ * Circuit breaker configuration for the connector.
130
+ * Prevents cascading failures by stopping requests when service is down.
131
+ */
132
+ interface ConnectorCircuitBreakerConfig {
133
+ /**
134
+ * Enable circuit breaker pattern.
135
+ * @default false
136
+ */
137
+ enabled: boolean;
138
+ /**
139
+ * Number of failures required to trip the circuit.
140
+ * @default 5
141
+ */
142
+ failureThreshold?: number;
143
+ /**
144
+ * Time window in ms for counting failures.
145
+ * @default 60000 (60 seconds)
146
+ */
147
+ failureWindowMs?: number;
148
+ /**
149
+ * Initial delay before transitioning from OPEN to HALF_OPEN.
150
+ * @default 1000 (1 second)
151
+ */
152
+ initialRecoveryDelayMs?: number;
153
+ /**
154
+ * Maximum delay for exponential backoff.
155
+ * @default 32000 (32 seconds)
156
+ */
157
+ maxRecoveryDelayMs?: number;
158
+ }
120
159
  /**
121
160
  * Options for creating a SupabaseConnector
122
161
  */
@@ -161,6 +200,19 @@ interface SupabaseConnectorOptions {
161
200
  * Use this to notify the UI layer about detected conflicts.
162
201
  */
163
202
  conflictBus?: ConflictBus;
203
+ /**
204
+ * Optional: Configuration for retry behavior on upload failures.
205
+ * Allows customizing retry attempts, delays, and backoff for different error types.
206
+ * @default DEFAULT_RETRY_CONFIG
207
+ */
208
+ retryConfig?: Partial<RetryConfig>;
209
+ /**
210
+ * Optional: Configuration for circuit breaker pattern.
211
+ * When enabled, prevents cascading failures by stopping requests when
212
+ * the service is experiencing high failure rates.
213
+ * @default { enabled: false }
214
+ */
215
+ circuitBreaker?: ConnectorCircuitBreakerConfig;
164
216
  }
165
217
  /**
166
218
  * Configuration passed to PowerSyncProvider for connector setup
@@ -192,6 +244,12 @@ interface ConnectorConfig {
192
244
  /** Refresh token when it expires within this many seconds (default: 60) */
193
245
  refreshThresholdSeconds?: number;
194
246
  };
247
+ /**
248
+ * Optional retry configuration for upload failures.
249
+ * Allows customizing retry attempts, delays, and backoff for different error types.
250
+ * @default DEFAULT_RETRY_CONFIG
251
+ */
252
+ retryConfig?: Partial<RetryConfig>;
195
253
  }
196
254
  /**
197
255
  * Function that determines which Supabase schema a table belongs to.
@@ -247,6 +305,39 @@ interface PowerSyncCredentials {
247
305
  /** When the token expires */
248
306
  expiresAt?: Date;
249
307
  }
308
+ /**
309
+ * Configuration for a single retry category
310
+ */
311
+ interface RetryStrategyConfig {
312
+ /** Maximum number of retry attempts */
313
+ maxRetries: number;
314
+ /** Initial delay in milliseconds */
315
+ baseDelayMs: number;
316
+ /** Maximum delay cap in milliseconds */
317
+ maxDelayMs: number;
318
+ /** Multiplier for exponential backoff */
319
+ backoffMultiplier: number;
320
+ }
321
+ /**
322
+ * Full retry configuration for the connector
323
+ */
324
+ interface RetryConfig {
325
+ /** Retry config for transient errors (network, server 5xx) */
326
+ transient: RetryStrategyConfig;
327
+ /** Retry config for permanent errors (RLS, validation, constraints) */
328
+ permanent: RetryStrategyConfig;
329
+ }
330
+ /**
331
+ * Default retry configuration
332
+ *
333
+ * Uses fast exponential backoff for transient errors (network issues):
334
+ * - Transient: 1s → 2s → 4s
335
+ *
336
+ * Permanent errors (RLS violations, constraint errors) get NO retries
337
+ * because they will never succeed - fail fast and surface to user.
338
+ * PowerSync's native retry mechanism will re-attempt on next sync cycle.
339
+ */
340
+ declare const DEFAULT_RETRY_CONFIG: RetryConfig;
250
341
 
251
342
  /**
252
343
  * Supabase Connector for PowerSync
@@ -323,12 +414,39 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
323
414
  private activeProjectIds;
324
415
  private resolvedConflicts;
325
416
  private unsubscribeResolution?;
417
+ private versionColumnPromises;
418
+ private isDestroyed;
419
+ private retryConfig;
420
+ private autoRetryPaused;
326
421
  constructor(options: SupabaseConnectorOptions);
327
422
  /**
328
423
  * Clean up resources (unsubscribe from event listeners).
329
424
  * Call this when the connector is no longer needed.
330
425
  */
331
426
  destroy(): void;
427
+ /**
428
+ * Pause automatic retry of failed uploads.
429
+ * Use this when the user goes offline intentionally or wants manual control.
430
+ */
431
+ pauseAutoRetry(): void;
432
+ /**
433
+ * Resume automatic retry of failed uploads.
434
+ */
435
+ resumeAutoRetry(): void;
436
+ /**
437
+ * Process a single CRUD entry with exponential backoff retry.
438
+ *
439
+ * This method uses a two-phase approach:
440
+ * 1. First attempt - try the operation to classify the error type
441
+ * 2. Retry phase - use the appropriate config (transient vs permanent) based on classification
442
+ *
443
+ * This fixes the issue where reassigning selectedConfig inside withExponentialBackoff's
444
+ * callback had no effect because the config was already destructured at call time.
445
+ *
446
+ * @param entry - The CRUD entry to process
447
+ * @throws Error if all retries exhausted (for critical failures)
448
+ */
449
+ private processWithRetry;
332
450
  /**
333
451
  * Set the active project IDs for scoped sync.
334
452
  * Call this when user selects/opens projects.
@@ -358,13 +476,37 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
358
476
  * 5. Applies resolution or skips entry based on handler response
359
477
  */
360
478
  uploadData(database: AbstractPowerSyncDatabase): Promise<void>;
479
+ /**
480
+ * Finalize a transaction by completing it after all entries processed successfully.
481
+ * Extracted to eliminate duplication between uploadData and processTransaction.
482
+ *
483
+ * @param context - The finalization context containing results and transaction
484
+ */
485
+ private finalizeTransaction;
361
486
  /**
362
487
  * Process a transaction without conflict detection.
363
- * Used when conflict detection is disabled.
488
+ * Uses batched operations for PUT and DELETE, individual processing for PATCH.
364
489
  */
365
490
  private processTransaction;
491
+ /**
492
+ * Process batched PUT (upsert) operations for a single table.
493
+ * Falls back to individual processing if batch fails.
494
+ * CRITICAL: Throws on first failure to maintain transaction atomicity.
495
+ * @returns Array of successfully processed entries
496
+ * @throws Error on first failure - keeps entire transaction in ps_crud
497
+ */
498
+ private processBatchedPuts;
499
+ /**
500
+ * Process batched DELETE operations for a single table.
501
+ * Falls back to individual processing if batch fails.
502
+ * CRITICAL: Throws on first failure to maintain transaction atomicity.
503
+ * @returns Array of successfully processed entries
504
+ * @throws Error on first failure - keeps entire transaction in ps_crud
505
+ */
506
+ private processBatchedDeletes;
366
507
  /**
367
508
  * Check if a table has a _version column (cached).
509
+ * P4.1: Uses Promise-based locking to prevent duplicate concurrent queries.
368
510
  */
369
511
  private checkVersionColumn;
370
512
  /**
@@ -372,12 +514,6 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
372
514
  * Used for partial sync resolution.
373
515
  */
374
516
  private filterFields;
375
- /**
376
- * Process a single CRUD operation.
377
- *
378
- * UUID-native tables (public schema, post-migration) use `id` as the UUID column.
379
- * Core schema tables (Profile, Comment, CommentSection) still use a separate `uuid` column.
380
- */
381
517
  /**
382
518
  * Process a single CRUD operation.
383
519
  *
@@ -386,4 +522,4 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
386
522
  private processCrudEntry;
387
523
  }
388
524
 
389
- export { type ConnectorConfig as C, type FieldConflict as F, type PowerSyncCredentials as P, type ResolutionListener as R, SupabaseConnector as S, type SupabaseConnectorOptions as a, type SchemaRouter as b, type CrudHandler as c, defaultSchemaRouter as d, ConflictBus as e, type ConflictCheckResult as f, type ConflictResolution as g, type ConflictHandler as h, type ConflictDetectionConfig as i, type ConflictListener as j };
525
+ export { type ConnectorCircuitBreakerConfig as C, DEFAULT_RETRY_CONFIG as D, type FieldConflict as F, type PowerSyncCredentials as P, type RetryStrategyConfig as R, SupabaseConnector as S, type SupabaseConnectorOptions as a, type ConnectorConfig as b, type SchemaRouter as c, defaultSchemaRouter as d, type CrudHandler as e, type RetryConfig as f, ConflictBus as g, type ConflictCheckResult as h, type ConflictResolution as i, type ConflictHandler as j, type ConflictDetectionConfig as k, type ConflictListener as l, type ResolutionListener as m };