@pol-studios/powersync 1.0.6 → 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 (118) 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-R4YFWQ3Q.js → chunk-H772V6XQ.js} +304 -51
  22. package/dist/chunk-H772V6XQ.js.map +1 -0
  23. package/dist/{chunk-62J2DPKX.js → chunk-HFOFLW5F.js} +396 -412
  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 -3
  48. package/dist/connector/index.js +12 -4
  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 +100 -12
  55. package/dist/index.js +148 -38
  56. package/dist/index.native.d.ts +20 -10
  57. package/dist/index.native.js +148 -39
  58. package/dist/index.web.d.ts +20 -10
  59. package/dist/index.web.js +149 -39
  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 +447 -21
  72. package/dist/provider/index.js +33 -13
  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-l3iL9Jte.d.ts → supabase-connector-qLm-WHkM.d.ts} +90 -25
  92. package/dist/sync/index.d.ts +288 -23
  93. package/dist/sync/index.js +22 -10
  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-5FIMA26D.js +0 -1
  101. package/dist/chunk-62J2DPKX.js.map +0 -1
  102. package/dist/chunk-7EMDVIZX.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-KCDG2MNP.js +0 -1431
  106. package/dist/chunk-KCDG2MNP.js.map +0 -1
  107. package/dist/chunk-OLHGI472.js +0 -1
  108. package/dist/chunk-PAFBKNL3.js +0 -99
  109. package/dist/chunk-PAFBKNL3.js.map +0 -1
  110. package/dist/chunk-R4YFWQ3Q.js.map +0 -1
  111. package/dist/chunk-V6LJ6MR2.js +0 -740
  112. package/dist/chunk-V6LJ6MR2.js.map +0 -1
  113. package/dist/chunk-VJCL2SWD.js +0 -1
  114. package/dist/failed-upload-store-C0cLxxPz.d.ts +0 -33
  115. /package/dist/{chunk-32OLICZO.js.map → chunk-DGUM43GV.js.map} +0 -0
  116. /package/dist/{chunk-5FIMA26D.js.map → chunk-GKF7TOMT.js.map} +0 -0
  117. /package/dist/{chunk-OLHGI472.js.map → chunk-KGSFAE5B.js.map} +0 -0
  118. /package/dist/{chunk-VJCL2SWD.js.map → chunk-LNL64IJZ.js.map} +0 -0
@@ -1,3 +1,16 @@
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,
3
16
  CompletedTransactionsContext,
@@ -6,18 +19,20 @@ import {
6
19
  FailedTransactionsContext,
7
20
  PendingMutationsContext,
8
21
  PowerSyncContext,
9
- PowerSyncProvider,
10
22
  SyncActivityContext,
11
23
  SyncMetricsContext,
12
24
  SyncModeContext,
13
25
  SyncStatusContext,
14
26
  useAttachmentQueue,
27
+ useAttachmentQueueReady,
28
+ useCompletedTransactions,
15
29
  useCompletedTransactionsContext,
16
30
  useConnectionHealth,
17
31
  useConnectionStatus,
18
32
  useDatabase,
19
33
  useDownloadProgress,
20
34
  useEntitySyncStatus,
35
+ useFailedTransactions,
21
36
  useFailedTransactionsContext,
22
37
  useIsSyncing,
23
38
  useOnlineStatus,
@@ -33,18 +48,18 @@ import {
33
48
  useSyncModeContext,
34
49
  useSyncStatus,
35
50
  useUploadStatus
36
- } from "../chunk-KCDG2MNP.js";
37
- import "../chunk-V6LJ6MR2.js";
38
- import {
39
- DEFAULT_CONNECTION_HEALTH,
40
- DEFAULT_SYNC_CONFIG,
41
- DEFAULT_SYNC_METRICS,
42
- DEFAULT_SYNC_STATUS
43
- } from "../chunk-R4YFWQ3Q.js";
44
- import "../chunk-EJ23MXPQ.js";
45
- import "../chunk-62J2DPKX.js";
46
- import "../chunk-PAFBKNL3.js";
47
- 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";
48
63
  export {
49
64
  AttachmentQueueContext,
50
65
  CompletedTransactionsContext,
@@ -55,20 +70,25 @@ export {
55
70
  DEFAULT_SYNC_METRICS,
56
71
  DEFAULT_SYNC_STATUS,
57
72
  FailedTransactionsContext,
73
+ OfflineDataProvider,
58
74
  PendingMutationsContext,
59
75
  PowerSyncContext,
60
76
  PowerSyncProvider,
77
+ ProviderBridge,
61
78
  SyncActivityContext,
62
79
  SyncMetricsContext,
63
80
  SyncModeContext,
64
81
  SyncStatusContext,
65
82
  useAttachmentQueue,
83
+ useAttachmentQueueReady,
84
+ useCompletedTransactions,
66
85
  useCompletedTransactionsContext,
67
86
  useConnectionHealth,
68
87
  useConnectionStatus,
69
88
  useDatabase,
70
89
  useDownloadProgress,
71
90
  useEntitySyncStatus,
91
+ useFailedTransactions,
72
92
  useFailedTransactionsContext,
73
93
  useIsSyncing,
74
94
  useOnlineStatus,
@@ -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,7 +1,6 @@
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
- import { F as FailedUpload } from './failed-upload-store-C0cLxxPz.js';
5
4
 
6
5
  /**
7
6
  * Conflict Types for @pol-studios/powersync
@@ -86,10 +85,13 @@ type ResolutionListener = (table: string, recordId: string, resolution: Conflict
86
85
  * 4. Connector subscribes via bus.onResolution() -> triggers re-upload
87
86
  */
88
87
  declare class ConflictBus {
88
+ private static MAX_PENDING;
89
89
  private conflictListeners;
90
90
  private resolutionListeners;
91
+ private pendingConflicts;
91
92
  /**
92
93
  * Subscribe to conflict detection events.
94
+ * Flushes any pending conflicts to ALL listeners (including the new one).
93
95
  * @returns Unsubscribe function
94
96
  */
95
97
  onConflict(listener: ConflictListener): () => void;
@@ -100,6 +102,7 @@ declare class ConflictBus {
100
102
  onResolution(listener: ResolutionListener): () => void;
101
103
  /**
102
104
  * Emit a conflict detection event (called by connector).
105
+ * If no listeners are subscribed, queues the conflict for later delivery.
103
106
  */
104
107
  emitConflict(conflict: ConflictCheckResult): void;
105
108
  /**
@@ -107,9 +110,13 @@ declare class ConflictBus {
107
110
  */
108
111
  emitResolution(table: string, recordId: string, resolution: ConflictResolution): void;
109
112
  /**
110
- * Clear all listeners (for cleanup).
113
+ * Clear all listeners and pending conflicts (for cleanup).
111
114
  */
112
115
  destroy(): void;
116
+ /**
117
+ * Get the number of pending conflicts (useful for debugging/testing).
118
+ */
119
+ get pendingCount(): number;
113
120
  }
114
121
 
115
122
  /**
@@ -118,6 +125,37 @@ declare class ConflictBus {
118
125
  * Defines interfaces for PowerSync backend connectors.
119
126
  */
120
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
+ }
121
159
  /**
122
160
  * Options for creating a SupabaseConnector
123
161
  */
@@ -168,6 +206,13 @@ interface SupabaseConnectorOptions {
168
206
  * @default DEFAULT_RETRY_CONFIG
169
207
  */
170
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;
171
216
  }
172
217
  /**
173
218
  * Configuration passed to PowerSyncProvider for connector setup
@@ -284,6 +329,13 @@ interface RetryConfig {
284
329
  }
285
330
  /**
286
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.
287
339
  */
288
340
  declare const DEFAULT_RETRY_CONFIG: RetryConfig;
289
341
 
@@ -362,6 +414,8 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
362
414
  private activeProjectIds;
363
415
  private resolvedConflicts;
364
416
  private unsubscribeResolution?;
417
+ private versionColumnPromises;
418
+ private isDestroyed;
365
419
  private retryConfig;
366
420
  private autoRetryPaused;
367
421
  constructor(options: SupabaseConnectorOptions);
@@ -379,23 +433,16 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
379
433
  * Resume automatic retry of failed uploads.
380
434
  */
381
435
  resumeAutoRetry(): void;
382
- /**
383
- * Manually retry all failed uploads that are ready for retry.
384
- * This processes entries from the failed upload store.
385
- */
386
- retryFailedUploads(): Promise<void>;
387
- /**
388
- * Clear all failed uploads from the store.
389
- * Use with caution - this discards all pending retries.
390
- */
391
- clearFailedUploads(): void;
392
- /**
393
- * Get all failed uploads from the store.
394
- */
395
- getFailedUploads(): FailedUpload[];
396
436
  /**
397
437
  * Process a single CRUD entry with exponential backoff retry.
398
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
+ *
399
446
  * @param entry - The CRUD entry to process
400
447
  * @throws Error if all retries exhausted (for critical failures)
401
448
  */
@@ -429,13 +476,37 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
429
476
  * 5. Applies resolution or skips entry based on handler response
430
477
  */
431
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;
432
486
  /**
433
487
  * Process a transaction without conflict detection.
434
- * Used when conflict detection is disabled.
488
+ * Uses batched operations for PUT and DELETE, individual processing for PATCH.
435
489
  */
436
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;
437
507
  /**
438
508
  * Check if a table has a _version column (cached).
509
+ * P4.1: Uses Promise-based locking to prevent duplicate concurrent queries.
439
510
  */
440
511
  private checkVersionColumn;
441
512
  /**
@@ -443,12 +514,6 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
443
514
  * Used for partial sync resolution.
444
515
  */
445
516
  private filterFields;
446
- /**
447
- * Process a single CRUD operation.
448
- *
449
- * UUID-native tables (public schema, post-migration) use `id` as the UUID column.
450
- * Core schema tables (Profile, Comment, CommentSection) still use a separate `uuid` column.
451
- */
452
517
  /**
453
518
  * Process a single CRUD operation.
454
519
  *
@@ -457,4 +522,4 @@ declare class SupabaseConnector implements PowerSyncBackendConnector {
457
522
  private processCrudEntry;
458
523
  }
459
524
 
460
- export { type ConnectorConfig 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 SchemaRouter as b, type CrudHandler as c, defaultSchemaRouter as d, type RetryConfig as e, ConflictBus as f, type ConflictCheckResult as g, type ConflictResolution as h, type ConflictHandler as i, type ConflictDetectionConfig as j, type ConflictListener as k, type ResolutionListener as l };
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 };