@pol-studios/powersync 1.0.7 → 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.
- package/README.md +933 -0
- package/dist/CacheSettingsManager-uz-kbnRH.d.ts +461 -0
- package/dist/attachments/index.d.ts +709 -6
- package/dist/attachments/index.js +133 -5
- package/dist/chunk-24RDMMCL.js +44 -0
- package/dist/chunk-24RDMMCL.js.map +1 -0
- package/dist/chunk-4TXTAEF2.js +2060 -0
- package/dist/chunk-4TXTAEF2.js.map +1 -0
- package/dist/chunk-63PXSPIN.js +358 -0
- package/dist/chunk-63PXSPIN.js.map +1 -0
- package/dist/chunk-654ERHA7.js +1 -0
- package/dist/{chunk-BREGB4WL.js → chunk-BRXQNASY.js} +287 -335
- package/dist/chunk-BRXQNASY.js.map +1 -0
- package/dist/{chunk-DHYUBVP7.js → chunk-CAB26E6F.js} +20 -9
- package/dist/chunk-CAB26E6F.js.map +1 -0
- package/dist/{chunk-H772V6XQ.js → chunk-CUCAYK7Z.js} +7 -43
- package/dist/chunk-CUCAYK7Z.js.map +1 -0
- package/dist/{chunk-4C3RY5SU.js → chunk-HWSNV45P.js} +76 -1
- package/dist/chunk-HWSNV45P.js.map +1 -0
- package/dist/{chunk-HFOFLW5F.js → chunk-KN2IZERF.js} +139 -6
- package/dist/chunk-KN2IZERF.js.map +1 -0
- package/dist/{chunk-UEYRTLKE.js → chunk-P4HZA6ZT.js} +20 -9
- package/dist/chunk-P4HZA6ZT.js.map +1 -0
- package/dist/chunk-T4AO7JIG.js +1 -0
- package/dist/{chunk-XQAJM2MW.js → chunk-VACPAAQZ.js} +33 -2
- package/dist/{chunk-XQAJM2MW.js.map → chunk-VACPAAQZ.js.map} +1 -1
- package/dist/{chunk-53WH2JJV.js → chunk-WN5ZJ3E2.js} +5 -8
- package/dist/chunk-WN5ZJ3E2.js.map +1 -0
- package/dist/chunk-XAEII4ZX.js +456 -0
- package/dist/chunk-XAEII4ZX.js.map +1 -0
- package/dist/chunk-XOY2CJ67.js +289 -0
- package/dist/chunk-XOY2CJ67.js.map +1 -0
- package/dist/chunk-YHTZ7VMV.js +1 -0
- package/dist/{chunk-MKD2VCX3.js → chunk-Z6VOBGTU.js} +8 -8
- package/dist/chunk-Z6VOBGTU.js.map +1 -0
- package/dist/chunk-ZM4ENYMF.js +230 -0
- package/dist/chunk-ZM4ENYMF.js.map +1 -0
- package/dist/connector/index.d.ts +56 -3
- package/dist/connector/index.js +8 -5
- package/dist/core/index.d.ts +12 -1
- package/dist/core/index.js +3 -2
- package/dist/error/index.js +0 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.js +191 -29
- package/dist/index.native.d.ts +11 -9
- package/dist/index.native.js +191 -29
- package/dist/index.web.d.ts +11 -9
- package/dist/index.web.js +191 -29
- package/dist/maintenance/index.js +0 -1
- package/dist/platform/index.js +0 -2
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/index.native.js +1 -2
- package/dist/platform/index.web.js +0 -1
- package/dist/pol-attachment-queue-BVAIueoP.d.ts +817 -0
- package/dist/provider/index.d.ts +38 -34
- package/dist/provider/index.js +11 -12
- package/dist/react/index.d.ts +372 -0
- package/dist/react/index.js +25 -0
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +22 -8
- package/dist/storage/index.native.d.ts +3 -3
- package/dist/storage/index.native.js +21 -7
- package/dist/storage/index.web.d.ts +3 -3
- package/dist/storage/index.web.js +21 -7
- package/dist/storage/upload/index.d.ts +7 -8
- package/dist/storage/upload/index.js +3 -3
- package/dist/storage/upload/index.native.d.ts +7 -8
- package/dist/storage/upload/index.native.js +4 -3
- package/dist/storage/upload/index.web.d.ts +1 -4
- package/dist/storage/upload/index.web.js +3 -3
- package/dist/supabase-connector-T9vHq_3i.d.ts +202 -0
- package/dist/sync/index.js +3 -3
- package/dist/{supabase-connector-qLm-WHkM.d.ts → types-B212hgfA.d.ts} +48 -170
- package/dist/{types-BVacP54t.d.ts → types-CyvBaAl8.d.ts} +12 -4
- package/dist/types-D0WcHrq6.d.ts +234 -0
- package/package.json +18 -4
- package/dist/CacheSettingsManager-1exbOC6S.d.ts +0 -261
- package/dist/chunk-4C3RY5SU.js.map +0 -1
- package/dist/chunk-53WH2JJV.js.map +0 -1
- package/dist/chunk-BREGB4WL.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-DHYUBVP7.js.map +0 -1
- package/dist/chunk-GKF7TOMT.js +0 -1
- package/dist/chunk-H772V6XQ.js.map +0 -1
- package/dist/chunk-HFOFLW5F.js.map +0 -1
- package/dist/chunk-KGSFAE5B.js +0 -1
- package/dist/chunk-LNL64IJZ.js +0 -1
- package/dist/chunk-MKD2VCX3.js.map +0 -1
- package/dist/chunk-UEYRTLKE.js.map +0 -1
- package/dist/chunk-WQ5MPAVC.js +0 -449
- package/dist/chunk-WQ5MPAVC.js.map +0 -1
- package/dist/chunk-ZEOKPWUC.js +0 -1165
- package/dist/chunk-ZEOKPWUC.js.map +0 -1
- package/dist/pol-attachment-queue-C7YNXXhK.d.ts +0 -676
- package/dist/types-Bgvx7-E8.d.ts +0 -187
- /package/dist/{chunk-DGUM43GV.js.map → chunk-654ERHA7.js.map} +0 -0
- /package/dist/{chunk-GKF7TOMT.js.map → chunk-T4AO7JIG.js.map} +0 -0
- /package/dist/{chunk-KGSFAE5B.js.map → chunk-YHTZ7VMV.js.map} +0 -0
- /package/dist/{chunk-LNL64IJZ.js.map → react/index.js.map} +0 -0
package/dist/types-Bgvx7-E8.d.ts
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { LoggerAdapter } from './platform/index.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Storage Types for @pol-studios/powersync
|
|
5
|
-
*
|
|
6
|
-
* Defines interfaces for pluggable storage adapters supporting
|
|
7
|
-
* different backend storage providers (Supabase, S3, etc.).
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Function type for resolving storage bucket from a file path.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* const resolver: BucketResolver = (path) => {
|
|
15
|
-
* if (path.startsWith('avatars/')) return 'user-avatars';
|
|
16
|
-
* if (path.startsWith('docs/')) return 'documents';
|
|
17
|
-
* return 'default-bucket';
|
|
18
|
-
* };
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
type BucketResolver = (storagePath: string) => string;
|
|
22
|
-
/**
|
|
23
|
-
* Configuration for bucket resolution.
|
|
24
|
-
* Supports multiple strategies: default bucket, prefix mapping, or custom resolver.
|
|
25
|
-
*/
|
|
26
|
-
interface BucketConfig {
|
|
27
|
-
/** Default bucket when no other rule matches */
|
|
28
|
-
defaultBucket: string;
|
|
29
|
-
/**
|
|
30
|
-
* Map of path prefixes to bucket names.
|
|
31
|
-
* Checked in iteration order (use Map to preserve order).
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* const bucketMap = new Map([
|
|
36
|
-
* ['avatars/', 'user-avatars'],
|
|
37
|
-
* ['docs/', 'documents'],
|
|
38
|
-
* ]);
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
bucketMap?: Map<string, string>;
|
|
42
|
-
/**
|
|
43
|
-
* Custom resolver function (takes precedence over bucketMap).
|
|
44
|
-
* Return undefined to fall through to bucketMap/defaultBucket.
|
|
45
|
-
*/
|
|
46
|
-
resolver?: (storagePath: string) => string | undefined;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Resolve bucket from a storage path using BucketConfig.
|
|
50
|
-
*
|
|
51
|
-
* Resolution order:
|
|
52
|
-
* 1. Custom resolver (if provided and returns a value)
|
|
53
|
-
* 2. bucketMap prefix matching (if provided)
|
|
54
|
-
* 3. defaultBucket
|
|
55
|
-
*/
|
|
56
|
-
declare function resolveBucketFromConfig(config: BucketConfig, storagePath: string): string;
|
|
57
|
-
/**
|
|
58
|
-
* Interface for remote storage download adapters.
|
|
59
|
-
* Implement this to support non-Supabase storage backends.
|
|
60
|
-
*/
|
|
61
|
-
interface RemoteStorageAdapter {
|
|
62
|
-
/**
|
|
63
|
-
* Download a file from remote storage to local path.
|
|
64
|
-
*/
|
|
65
|
-
download(remotePath: string, localPath: string): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Get a signed download URL for a remote file.
|
|
68
|
-
*/
|
|
69
|
-
getDownloadUrl(remotePath: string): Promise<string>;
|
|
70
|
-
/**
|
|
71
|
-
* Check if a file exists in remote storage.
|
|
72
|
-
*/
|
|
73
|
-
exists(remotePath: string): Promise<boolean>;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Options for upload operations.
|
|
77
|
-
*/
|
|
78
|
-
interface UploadOptions {
|
|
79
|
-
contentType?: string;
|
|
80
|
-
onProgress?: (progress: {
|
|
81
|
-
loaded: number;
|
|
82
|
-
total: number;
|
|
83
|
-
}) => void;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Interface for attachment upload handlers.
|
|
87
|
-
* Implement this to support non-Supabase upload backends.
|
|
88
|
-
*/
|
|
89
|
-
interface AttachmentUploadHandler {
|
|
90
|
-
/**
|
|
91
|
-
* Upload a file from local path to remote storage.
|
|
92
|
-
*/
|
|
93
|
-
upload(localPath: string, remotePath: string, options?: UploadOptions): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* Get a signed upload URL (optional, for direct uploads).
|
|
96
|
-
*/
|
|
97
|
-
getUploadUrl?(remotePath: string): Promise<string>;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Interface for platform-specific upload handlers.
|
|
101
|
-
* Used by SupabaseUploadHandler implementations.
|
|
102
|
-
*
|
|
103
|
-
* Note: This is named StorageUploadHandler to avoid conflicts with
|
|
104
|
-
* the UploadHandler interface in attachments/types.ts which has
|
|
105
|
-
* slightly different semantics.
|
|
106
|
-
*/
|
|
107
|
-
interface StorageUploadHandler {
|
|
108
|
-
/**
|
|
109
|
-
* Upload a file to remote storage.
|
|
110
|
-
*
|
|
111
|
-
* @param storagePath - Remote path in storage bucket
|
|
112
|
-
* @param localFileUri - Local file URI (file:// on native, blob URL on web)
|
|
113
|
-
* @param mediaType - MIME type of the file
|
|
114
|
-
* @param signal - Optional AbortSignal for cancellation
|
|
115
|
-
*/
|
|
116
|
-
uploadFile(storagePath: string, localFileUri: string, mediaType: string, signal?: AbortSignal): Promise<void>;
|
|
117
|
-
/**
|
|
118
|
-
* Resolve the storage bucket for a given path.
|
|
119
|
-
*/
|
|
120
|
-
resolveBucket(storagePath: string): string;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Options for creating a SupabaseStorageAdapter.
|
|
125
|
-
*/
|
|
126
|
-
interface SupabaseStorageAdapterOptions {
|
|
127
|
-
/** Supabase client instance */
|
|
128
|
-
client: any;
|
|
129
|
-
/** Bucket configuration for multi-bucket routing */
|
|
130
|
-
bucketConfig: BucketConfig;
|
|
131
|
-
/**
|
|
132
|
-
* Custom signed URL expiry in seconds.
|
|
133
|
-
* @default 60 (short-lived for security)
|
|
134
|
-
*/
|
|
135
|
-
signedUrlExpiry?: number;
|
|
136
|
-
/**
|
|
137
|
-
* Optional logger for diagnostic messages.
|
|
138
|
-
* If not provided, falls back to console.warn for warnings.
|
|
139
|
-
*/
|
|
140
|
-
logger?: LoggerAdapter;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Result of a download operation.
|
|
144
|
-
*/
|
|
145
|
-
interface DownloadResult {
|
|
146
|
-
/** Local file path where the file was saved */
|
|
147
|
-
localPath: string;
|
|
148
|
-
/** MIME type of the downloaded file */
|
|
149
|
-
mimeType: string;
|
|
150
|
-
/** Size of the downloaded file in bytes */
|
|
151
|
-
size: number;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* PowerSync StorageAdapter interface from @powersync/attachments.
|
|
155
|
-
* Re-declared here to avoid import dependency.
|
|
156
|
-
*/
|
|
157
|
-
interface PowerSyncStorageAdapter {
|
|
158
|
-
/** Upload a file to remote storage */
|
|
159
|
-
uploadFile(filename: string, data: ArrayBuffer, options?: {
|
|
160
|
-
mediaType?: string;
|
|
161
|
-
}): Promise<void>;
|
|
162
|
-
/** Download a file from remote storage */
|
|
163
|
-
downloadFile(filePath: string): Promise<Blob>;
|
|
164
|
-
/** Write a file to local storage */
|
|
165
|
-
writeFile(fileURI: string, base64Data: string, options?: {
|
|
166
|
-
encoding?: 'utf8' | 'base64';
|
|
167
|
-
}): Promise<void>;
|
|
168
|
-
/** Read a file from local storage */
|
|
169
|
-
readFile(fileURI: string, options?: {
|
|
170
|
-
encoding?: 'utf8' | 'base64';
|
|
171
|
-
mediaType?: string;
|
|
172
|
-
}): Promise<ArrayBuffer>;
|
|
173
|
-
/** Delete a local file */
|
|
174
|
-
deleteFile(uri: string, options?: {
|
|
175
|
-
filename?: string;
|
|
176
|
-
}): Promise<void>;
|
|
177
|
-
/** Check if a local file exists */
|
|
178
|
-
fileExists(fileURI: string): Promise<boolean>;
|
|
179
|
-
/** Create a directory */
|
|
180
|
-
makeDir(uri: string): Promise<void>;
|
|
181
|
-
/** Copy a file */
|
|
182
|
-
copyFile(sourceUri: string, targetUri: string): Promise<void>;
|
|
183
|
-
/** Get the user storage directory */
|
|
184
|
-
getUserStorageDirectory(): string;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export { type AttachmentUploadHandler as A, type BucketResolver as B, type DownloadResult as D, type PowerSyncStorageAdapter as P, type RemoteStorageAdapter as R, type StorageUploadHandler as S, type UploadOptions as U, type BucketConfig as a, type SupabaseStorageAdapterOptions as b, resolveBucketFromConfig as r };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|