react-native-cloud-sync 0.1.0 → 0.3.0
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 +58 -53
- package/ios/CloudSyncImpl.swift +25 -2
- package/lib/commonjs/config.js +11 -1
- package/lib/commonjs/config.js.map +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/cloudKitRest.js +205 -21
- package/lib/commonjs/internal/cloudKitRest.js.map +1 -1
- package/lib/commonjs/internal/googleDriveRest.js +173 -38
- package/lib/commonjs/internal/googleDriveRest.js.map +1 -1
- package/lib/commonjs/providers/cloudKit.js +89 -19
- package/lib/commonjs/providers/cloudKit.js.map +1 -1
- package/lib/commonjs/resolvers.js +68 -0
- package/lib/commonjs/resolvers.js.map +1 -1
- package/lib/module/config.js +10 -1
- package/lib/module/config.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/cloudKitRest.js +205 -21
- package/lib/module/internal/cloudKitRest.js.map +1 -1
- package/lib/module/internal/googleDriveRest.js +174 -39
- package/lib/module/internal/googleDriveRest.js.map +1 -1
- package/lib/module/providers/cloudKit.js +92 -22
- package/lib/module/providers/cloudKit.js.map +1 -1
- package/lib/module/resolvers.js +67 -0
- package/lib/module/resolvers.js.map +1 -1
- package/lib/typescript/commonjs/config.d.ts +8 -0
- package/lib/typescript/commonjs/config.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/cloudKitRest.d.ts +90 -0
- package/lib/typescript/commonjs/internal/cloudKitRest.d.ts.map +1 -1
- package/lib/typescript/commonjs/internal/googleDriveRest.d.ts +73 -8
- package/lib/typescript/commonjs/internal/googleDriveRest.d.ts.map +1 -1
- package/lib/typescript/commonjs/providers/cloudKit.d.ts +32 -13
- package/lib/typescript/commonjs/providers/cloudKit.d.ts.map +1 -1
- package/lib/typescript/commonjs/resolvers.d.ts +39 -0
- package/lib/typescript/commonjs/resolvers.d.ts.map +1 -1
- package/lib/typescript/module/config.d.ts +8 -0
- package/lib/typescript/module/config.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/internal/cloudKitRest.d.ts +90 -0
- package/lib/typescript/module/internal/cloudKitRest.d.ts.map +1 -1
- package/lib/typescript/module/internal/googleDriveRest.d.ts +73 -8
- package/lib/typescript/module/internal/googleDriveRest.d.ts.map +1 -1
- package/lib/typescript/module/providers/cloudKit.d.ts +32 -13
- package/lib/typescript/module/providers/cloudKit.d.ts.map +1 -1
- package/lib/typescript/module/resolvers.d.ts +39 -0
- package/lib/typescript/module/resolvers.d.ts.map +1 -1
- package/package.json +15 -3
- package/src/config.ts +12 -2
- package/src/index.ts +4 -1
- package/src/internal/cloudKitRest.ts +272 -29
- package/src/internal/googleDriveRest.ts +196 -42
- package/src/providers/cloudKit.ts +138 -41
- package/src/resolvers.ts +75 -0
|
@@ -3,8 +3,11 @@ import { type AbortLike } from './timeout';
|
|
|
3
3
|
* Google Drive `appDataFolder` REST client.
|
|
4
4
|
*
|
|
5
5
|
* `appDataFolder` is a hidden per-app, per-Google-account folder: nothing shows
|
|
6
|
-
* up in the user's visible Drive, and the data
|
|
7
|
-
*
|
|
6
|
+
* up in the user's visible Drive, and the data is tied to the Google account
|
|
7
|
+
* rather than the device or install, so reinstalling the app or switching
|
|
8
|
+
* devices doesn't lose it. It goes away only if the user disconnects the app
|
|
9
|
+
* from their Drive account or deletes the data folder directly - Google
|
|
10
|
+
* documents both as the ways this folder is actually removed.
|
|
8
11
|
*
|
|
9
12
|
* Auth is deliberately injected rather than owned. The library does not depend
|
|
10
13
|
* on `@react-native-google-signin/google-signin` (or any other sign-in library),
|
|
@@ -52,6 +55,37 @@ export interface GoogleDriveConfig {
|
|
|
52
55
|
* its own, so without this a dead socket hangs the transfer forever.
|
|
53
56
|
*/
|
|
54
57
|
timeoutMs?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Persists `uploadFile`'s resumable-session URI across process restarts.
|
|
60
|
+
*
|
|
61
|
+
* Without this, the session lives only in memory: a process killed mid-upload
|
|
62
|
+
* loses it, and the next `uploadFile` for the same name starts over from byte
|
|
63
|
+
* 0 even though Drive still has the bytes already accepted. With it, the next
|
|
64
|
+
* call finds the persisted session, asks Drive for the real offset, and
|
|
65
|
+
* resumes from there instead.
|
|
66
|
+
*
|
|
67
|
+
* A tiny JSON record, not file I/O - back it with AsyncStorage, MMKV, or a
|
|
68
|
+
* single row in whatever the host app already uses. Optional; omitting it
|
|
69
|
+
* keeps today's in-memory-only behaviour.
|
|
70
|
+
*/
|
|
71
|
+
sessionStore?: GoogleDriveSessionStore;
|
|
72
|
+
}
|
|
73
|
+
/** What `uploadFile` needs to resume a resumable-upload session later. */
|
|
74
|
+
export interface GoogleDriveUploadSession {
|
|
75
|
+
sessionUrl: string;
|
|
76
|
+
/** The source size the session was started against - resuming into a file
|
|
77
|
+
* that has since changed size would corrupt it, so a mismatch is treated
|
|
78
|
+
* as "start fresh" rather than resumed. */
|
|
79
|
+
size: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Host-supplied persistence for in-flight `uploadFile` sessions, keyed by the
|
|
83
|
+
* Drive file name. See {@link GoogleDriveConfig.sessionStore}.
|
|
84
|
+
*/
|
|
85
|
+
export interface GoogleDriveSessionStore {
|
|
86
|
+
get: (name: string) => Promise<GoogleDriveUploadSession | null>;
|
|
87
|
+
set: (name: string, session: GoogleDriveUploadSession) => Promise<void>;
|
|
88
|
+
remove: (name: string) => Promise<void>;
|
|
55
89
|
}
|
|
56
90
|
/** A local file `uploadFile` reads from, in fixed-size pieces. */
|
|
57
91
|
export interface DriveChunkSource {
|
|
@@ -114,6 +148,14 @@ export declare class GoogleDriveClient {
|
|
|
114
148
|
* caller inspects the response itself rather than getting a thrown rejection.
|
|
115
149
|
*/
|
|
116
150
|
private request;
|
|
151
|
+
/**
|
|
152
|
+
* Best-effort read of Drive's `error.errors[0].reason` from a failed
|
|
153
|
+
* response body - the only way a 403 status distinguishes an invalid token
|
|
154
|
+
* from quota-exceeded from a rate limit. Returns undefined for a body that
|
|
155
|
+
* is missing, unparseable, or doesn't carry the shape Drive documents,
|
|
156
|
+
* rather than throwing a second error while already handling one.
|
|
157
|
+
*/
|
|
158
|
+
private driveErrorReason;
|
|
117
159
|
/**
|
|
118
160
|
* Resolves a file name to its id within appDataFolder, or null if absent.
|
|
119
161
|
*
|
|
@@ -171,18 +213,41 @@ export declare class GoogleDriveClient {
|
|
|
171
213
|
* how many bytes it actually has and resuming from there - rather than
|
|
172
214
|
* restarting the transfer.
|
|
173
215
|
*
|
|
174
|
-
* That resumability
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
216
|
+
* That resumability spans a process restart too, when {@link
|
|
217
|
+
* GoogleDriveConfig.sessionStore} is configured: the session URI is persisted
|
|
218
|
+
* before the first chunk goes out, and a later `uploadFile` for the same name
|
|
219
|
+
* finds it, asks Drive for the real offset, and resumes from there instead of
|
|
220
|
+
* byte 0. Without a `sessionStore`, the session lives only in memory, exactly
|
|
221
|
+
* as before - a process that dies mid-upload loses it, and the next call
|
|
222
|
+
* starts fresh.
|
|
179
223
|
*/
|
|
180
224
|
uploadFile(name: string, source: DriveChunkSource, onProgress?: (bytesTransferred: number, bytesTotal: number) => void, signal?: AbortLike): Promise<void>;
|
|
225
|
+
/**
|
|
226
|
+
* Finds an existing session to resume, or starts a new one.
|
|
227
|
+
*
|
|
228
|
+
* A persisted session is trusted only when its recorded size still matches
|
|
229
|
+
* `total` - resuming a byte-range PUT into a file that has since changed
|
|
230
|
+
* would corrupt it, so a mismatch is treated the same as no session at all.
|
|
231
|
+
* A persisted session Drive no longer recognises (expired, or the upload id
|
|
232
|
+
* was never valid) is also treated as absent: `queryUploadOffset` failing is
|
|
233
|
+
* the signal, since there is no cheaper way to ask than trying to use it.
|
|
234
|
+
*/
|
|
235
|
+
private resumeOrStartSession;
|
|
181
236
|
private startResumableSession;
|
|
182
237
|
/** One chunk, with a single retry that re-queries the server's real offset first. */
|
|
183
238
|
private putChunkWithRetry;
|
|
184
239
|
private putChunk;
|
|
185
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* Asks Drive how much of an in-flight resumable session it actually has, or
|
|
242
|
+
* discovers the upload was already complete server-side - the completing
|
|
243
|
+
* chunk's own response can be lost the same way any other one can, and this
|
|
244
|
+
* status check gets the same completion response back in that case,
|
|
245
|
+
* `id` included.
|
|
246
|
+
*
|
|
247
|
+
* Throws (via `request`) when `sessionUrl` is not a session Drive
|
|
248
|
+
* recognises any more - expired, or never valid. Callers treat that as the
|
|
249
|
+
* signal to stop trusting it, since there is no cheaper way to ask.
|
|
250
|
+
*/
|
|
186
251
|
private queryUploadOffset;
|
|
187
252
|
/**
|
|
188
253
|
* Downloads `name` into `sink`, in the same fixed-size chunks `uploadFile`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"googleDriveRest.d.ts","sourceRoot":"","sources":["../../../../src/internal/googleDriveRest.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;AAEvE
|
|
1
|
+
{"version":3,"file":"googleDriveRest.d.ts","sourceRoot":"","sources":["../../../../src/internal/googleDriveRest.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;AAEvE;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1C,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@ -26,11 +26,13 @@ export declare const zones: {
|
|
|
26
26
|
/**
|
|
27
27
|
* Binary assets (`CKAsset`).
|
|
28
28
|
*
|
|
29
|
-
* Native
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* Native on iOS/macOS. On Android and web, `save`/`fetch` go through CloudKit
|
|
30
|
+
* Web Services' own asset-upload protocol (request a single-use upload URL,
|
|
31
|
+
* POST the bytes, attach the returned descriptor to the record) - see
|
|
32
|
+
* {@link MAX_ASSET_UPLOAD_BYTES} for the one hard limit that comes with it.
|
|
33
|
+
* Custom zones and the native temporary-directory fallback remain native-only
|
|
34
|
+
* (`ERR_UNSUPPORTED_PLATFORM`), since the REST client has no equivalent of
|
|
35
|
+
* either.
|
|
34
36
|
*
|
|
35
37
|
* Assets are deliberately an explicit API rather than something the store
|
|
36
38
|
* facade routes to automatically: the caller passes a file path, not a string,
|
|
@@ -40,9 +42,12 @@ export declare const assets: {
|
|
|
40
42
|
/**
|
|
41
43
|
* Uploads a local file as a field on a record.
|
|
42
44
|
*
|
|
43
|
-
* Progress is reported per record through {@link onProgress}
|
|
44
|
-
* streamed from disk
|
|
45
|
-
*
|
|
45
|
+
* Progress is reported per record through {@link onProgress}. Natively, a
|
|
46
|
+
* `CKAsset` is streamed from disk so a large file never has to be held in
|
|
47
|
+
* memory; over REST the whole file is read once, which is fine given
|
|
48
|
+
* {@link MAX_ASSET_UPLOAD_BYTES} - CloudKit Web Services itself caps a
|
|
49
|
+
* single asset upload at 15 MB, so nothing this package could stream would
|
|
50
|
+
* ever be large enough to need it.
|
|
46
51
|
*/
|
|
47
52
|
save: (options: {
|
|
48
53
|
recordName: string;
|
|
@@ -57,10 +62,12 @@ export declare const assets: {
|
|
|
57
62
|
* record or field does not exist.
|
|
58
63
|
*
|
|
59
64
|
* Pass `destinationUri` for anything the user is going to keep or hand to a
|
|
60
|
-
* share sheet.
|
|
61
|
-
* under a name derived from the record, and iOS may reclaim that
|
|
62
|
-
* time - fine for restoring straight back into the app, wrong for an
|
|
63
|
-
* Parent directories are created if they do not exist.
|
|
65
|
+
* share sheet. Natively, without it the file lands in the app's temporary
|
|
66
|
+
* directory under a name derived from the record, and iOS may reclaim that
|
|
67
|
+
* at any time - fine for restoring straight back into the app, wrong for an
|
|
68
|
+
* export. Parent directories are created if they do not exist. Over REST,
|
|
69
|
+
* `destinationUri` is required: there is no OS-managed temporary directory
|
|
70
|
+
* this package can fall back to without a native module.
|
|
64
71
|
*/
|
|
65
72
|
fetch: (options: {
|
|
66
73
|
recordName: string;
|
|
@@ -75,12 +82,24 @@ export declare const assets: {
|
|
|
75
82
|
* Identified by record and field rather than by a handle, because that is
|
|
76
83
|
* what identifies a transfer everywhere else in this API - `onProgress`
|
|
77
84
|
* reports the same pair, so a UI already has it.
|
|
85
|
+
*
|
|
86
|
+
* Native only, still - the REST transfer has no in-flight handle to cancel
|
|
87
|
+
* yet. Resolves `false` on Android/web rather than throwing, the same as
|
|
88
|
+
* before, so this is a known gap rather than a broken promise: a REST
|
|
89
|
+
* `save`/`fetch` cannot currently be stopped once started.
|
|
78
90
|
*/
|
|
79
91
|
cancel: (options: {
|
|
80
92
|
recordName: string;
|
|
81
93
|
fieldName: string;
|
|
82
94
|
}) => Promise<boolean>;
|
|
83
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Upload/download progress for asset transfers.
|
|
97
|
+
*
|
|
98
|
+
* Native on iOS/macOS, bridged from the same event every transfer already
|
|
99
|
+
* reports. On Android/web there is no native module to bridge, so this
|
|
100
|
+
* subscribes to the in-JS feed the REST `save`/`fetch` path publishes into
|
|
101
|
+
* instead - same event shape either way.
|
|
102
|
+
*/
|
|
84
103
|
onProgress: (listener: (e: AssetProgressEvent) => void) => Unsubscribe;
|
|
85
104
|
};
|
|
86
105
|
//# sourceMappingURL=cloudKit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudKit.d.ts","sourceRoot":"","sources":["../../../../src/providers/cloudKit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"cloudKit.d.ts","sourceRoot":"","sources":["../../../../src/providers/cloudKit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,kBAAkB,EAA0B,MAAM,0BAA0B,CAAA;AAI9G,OAAO,KAAK,EAGV,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,WAAW,EACZ,MAAM,UAAU,CAAA;AAiCjB,eAAO,MAAM,QAAQ,EAAE,aAoMtB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,GAAG;IAAE,IAAI,CAAC,EAAE,YAAY,CAAA;CAAE,GACnD,aAAa,CA8Ff;AAED,yEAAyE;AACzE,eAAO,MAAM,KAAK;uBACS,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;uBAQtB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;gBAQ/B,OAAO,CAAC,MAAM,EAAE,CAAC;CAQlC,CAAA;AAaD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM;IACjB;;;;;;;;;OASG;oBAEQ;QACP,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;QACjB,qCAAqC;QACrC,OAAO,EAAE,MAAM,CAAA;QACf,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KACzB,KACA,OAAO,CAAC,IAAI,CAAC;IA0DhB;;;;;;;;;;;OAWG;qBAEQ;QACP,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;QACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACxB,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,KACA,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA+CzB;;;;;;;;;;;;OAYG;sBAEQ;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KACjD,OAAO,CAAC,OAAO,CAAC;IAUnB;;;;;;;OAOG;2BACoB,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,KAAG,WAAW;CAkBrE,CAAA"}
|
|
@@ -46,6 +46,45 @@ export declare const resolveByPreferenceOrder: ResolveFn;
|
|
|
46
46
|
export declare function resolveByModifiedAt(options?: {
|
|
47
47
|
fallback?: ResolveFn;
|
|
48
48
|
}): ResolveFn;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves by merging JSON arrays across every candidate - the union of
|
|
51
|
+
* elements, not a winner-take-all pick.
|
|
52
|
+
*
|
|
53
|
+
* The case {@link resolveByTimestamp} and {@link resolveByModifiedAt} do not
|
|
54
|
+
* cover: a list of favorited item ids, a set of dismissed-tip ids, anything
|
|
55
|
+
* where two devices adding *different* elements between syncs should both
|
|
56
|
+
* survive rather than one write clobbering the other.
|
|
57
|
+
*
|
|
58
|
+
* Deletions do not propagate. Removing an element on one device and syncing
|
|
59
|
+
* does not remove it from the merged result, because nothing in a plain union
|
|
60
|
+
* distinguishes "never added" from "removed" - a plain array carries no
|
|
61
|
+
* tombstones. Track removals yourself (a separate `removedIds` set, synced the
|
|
62
|
+
* same way) if that matters for your data.
|
|
63
|
+
*
|
|
64
|
+
* A candidate that is not valid JSON, or whose JSON is not an array, is
|
|
65
|
+
* dropped rather than treated as empty - a value you cannot read as a list is
|
|
66
|
+
* not evidence that the list is empty. If every candidate drops out this way,
|
|
67
|
+
* falls back to preference order rather than returning `[]` and reading as
|
|
68
|
+
* "nothing favorited" on every device.
|
|
69
|
+
*
|
|
70
|
+
* Elements are deduplicated and ordered by first appearance across candidates
|
|
71
|
+
* in provider order, so the merged result is stable rather than reshuffling on
|
|
72
|
+
* every resolve. When two candidates hold the "same" element with different
|
|
73
|
+
* fields (an object whose non-key fields differ), the first-seen copy wins -
|
|
74
|
+
* this merges *membership*, not per-element conflicts. Primitives are
|
|
75
|
+
* deduplicated by value; supply `key` for arrays of objects.
|
|
76
|
+
*
|
|
77
|
+
* ```ts
|
|
78
|
+
* createCloudStore({
|
|
79
|
+
* providers: ['icloudKV', 'googleDrive'],
|
|
80
|
+
* writeMode: 'mirror',
|
|
81
|
+
* resolve: resolveByUnion({ key: item => item.id }),
|
|
82
|
+
* })
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveByUnion<T = unknown>(options?: {
|
|
86
|
+
key?: (item: T) => string | number;
|
|
87
|
+
}): ResolveFn;
|
|
49
88
|
/**
|
|
50
89
|
* Tries each resolver in turn and takes the first non-null answer.
|
|
51
90
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,SAAS,CAAA;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAc,GAAG,SAAS,CAqBjE;AAoBD,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,EAAE,SACa,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAO,GACrC,SAAS,CAsBX;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,SAAS,CAQnE"}
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,SAAS,CAAA;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAc,GAAG,SAAS,CAqBjE;AAoBD,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,EAAE,SACa,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAO,GACrC,SAAS,CAsBX;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,cAAc,CAAC,CAAC,GAAG,OAAO,EACxC,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAA;CAAO,GACnD,SAAS,CAyBX;AAYD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,SAAS,CAQnE"}
|
|
@@ -27,6 +27,14 @@ export declare function isGoogleDriveConfigured(): boolean;
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function configureGoogleDriveFiles(adapter: GoogleDriveFileAdapter): void;
|
|
29
29
|
export declare function getGoogleDriveFileAdapter(): GoogleDriveFileAdapter;
|
|
30
|
+
/**
|
|
31
|
+
* Same adapter and same `configureGoogleDriveFiles` call, under a name that
|
|
32
|
+
* doesn't imply it's Drive-specific. `cloudKitAssets`'s REST path (Android/web)
|
|
33
|
+
* reads and writes local files the exact same way `googleDriveFiles` does, and
|
|
34
|
+
* asking a host app to register two near-identical adapters for that would be
|
|
35
|
+
* pure friction for no benefit.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getSharedFileAdapter: typeof getGoogleDriveFileAdapter;
|
|
30
38
|
export declare function isGoogleDriveFilesConfigured(): boolean;
|
|
31
39
|
/** Test seam - drops all configured clients. */
|
|
32
40
|
export declare function __resetConfig(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAAy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AAoB,IAAI,iBAAiB,CAUxD;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAE/E;AAED,wBAAgB,yBAAyB,IAAI,sBAAsB,CAWlE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,kCAA4B,CAAA;AAE7D,wBAAgB,4BAA4B,IAAI,OAAO,CAEtD;AAED,gDAAgD;AAChD,wBAAgB,aAAa,IAAI,IAAI,CAIpC"}
|
|
@@ -13,7 +13,7 @@ export { googleDrive, createGoogleDriveProvider } from './providers/googleDrive.
|
|
|
13
13
|
export { googleDriveFiles } from './providers/googleDriveFiles.js';
|
|
14
14
|
export { createMemoryProvider } from './providers/memory.js';
|
|
15
15
|
export { createCloudStore, type CloudStore, type FlushResult, type MigrateOptions, type MigrateResult, type OutboxStorage } from './store.js';
|
|
16
|
-
export { resolveByTimestamp, resolveByModifiedAt, resolveByPreferenceOrder, resolveFirstOf } from './resolvers.js';
|
|
16
|
+
export { resolveByTimestamp, resolveByModifiedAt, resolveByPreferenceOrder, resolveByUnion, resolveFirstOf } from './resolvers.js';
|
|
17
17
|
export { checkKey, sanitizeKey } from './internal/keys.js';
|
|
18
18
|
/**
|
|
19
19
|
* The abort-signal shape the cancellable APIs accept.
|
|
@@ -24,7 +24,7 @@ export { checkKey, sanitizeKey } from './internal/keys.js';
|
|
|
24
24
|
export type { AbortLike } from './internal/timeout.js';
|
|
25
25
|
export { configureCloudKit, configureGoogleDrive, configureGoogleDriveFiles, isCloudKitConfigured, isGoogleDriveConfigured, isGoogleDriveFilesConfigured } from './config.js';
|
|
26
26
|
export type { CloudKitRestConfig } from './internal/cloudKitRest.js';
|
|
27
|
-
export type { GoogleDriveConfig, GoogleDriveFileAdapter } from './internal/googleDriveRest.js';
|
|
27
|
+
export type { GoogleDriveConfig, GoogleDriveFileAdapter, GoogleDriveSessionStore, GoogleDriveUploadSession } from './internal/googleDriveRest.js';
|
|
28
28
|
export { base64ToBytes, bytesToBase64 } from './internal/base64.js';
|
|
29
29
|
export { CloudSyncError, ErrorCode, isCancelled, isCloudSyncError, isRetryable, requiresUserAction } from './errors.js';
|
|
30
30
|
export type { CloudSyncErrorInfo } from './errors.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,QAAQ,EACR,WAAW,IAAI,mBAAmB,EAClC,IAAI,IAAI,YAAY,EACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,QAAQ,EACR,sBAAsB,EACtB,KAAK,IAAI,aAAa,EACtB,MAAM,IAAI,cAAc,EACzB,MAAM,yBAAsB,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA4B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAA+B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAA6B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,4BAAyB,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAA8B,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAoB,CAAA;AAGzD,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,YAAS,CAAA;AAChB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACf,MAAM,gBAAa,CAAA;AAGpB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAiB,CAAA;AAEvD;;;;;GAKG;AACH,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAoB,CAAA;AAGnD,OAAO,EACL,iBAA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ACzB,oBAAoB,EACpB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,aAAU,CAAA;AAEjB,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAAyB,CAAA;AACjE,YAAY,EACV,iBAAiB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,wBAAwB,EAC7F,MAAM,+BAA4B,CAAA;AAMnC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAmB,CAAA;AAGhE,OAAO,EACL,cAAc,EACd,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EACnB,MAAM,aAAU,CAAA;AACjB,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAU,CAAA;AAElD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,+BAA4B,CAAA;AACpF,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,gCAA6B,CAAA;AACtF,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,iCAA8B,CAAA;AAEvH,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACV,MAAM,YAAS,CAAA;AAChB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAS,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAA"}
|
|
@@ -42,6 +42,16 @@ export interface CloudKitRestConfig {
|
|
|
42
42
|
onAuthExpired?: () => Promise<void> | void;
|
|
43
43
|
/** Overridable for tests. Defaults to global `fetch`. */
|
|
44
44
|
fetchImpl?: typeof fetch;
|
|
45
|
+
/**
|
|
46
|
+
* Overridable for tests. Defaults to the global `XMLHttpRequest` constructor.
|
|
47
|
+
*
|
|
48
|
+
* Only used for the raw asset-bytes upload/download - `fetch` in React
|
|
49
|
+
* Native exposes no upload-progress events at all, and `XMLHttpRequest.upload
|
|
50
|
+
* .onprogress` (and its response-side `.onprogress`) are what the per-record
|
|
51
|
+
* progress `cloudKitAssets.onProgress` promises actually needs. Every other
|
|
52
|
+
* request in this client stays on `fetch`.
|
|
53
|
+
*/
|
|
54
|
+
xhrImpl?: () => XMLHttpRequest;
|
|
45
55
|
/**
|
|
46
56
|
* Abandon a request that has not answered in this long. Default 30000.
|
|
47
57
|
*
|
|
@@ -51,6 +61,29 @@ export interface CloudKitRestConfig {
|
|
|
51
61
|
*/
|
|
52
62
|
timeoutMs?: number;
|
|
53
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* CloudKit Web Services' own ceiling on a single asset upload, undocumented
|
|
66
|
+
* anywhere except the upload endpoint's own reference page: 15 MB, and the
|
|
67
|
+
* upload URL it hands out is valid for 15 minutes. Native `CKAsset` has no such
|
|
68
|
+
* limit - this is specific to the REST upload-token protocol.
|
|
69
|
+
*/
|
|
70
|
+
export declare const MAX_ASSET_UPLOAD_BYTES: number;
|
|
71
|
+
/**
|
|
72
|
+
* The "Asset Dictionary" CloudKit Web Services deals in - what the upload
|
|
73
|
+
* endpoint returns after receiving bytes, and what a fetched record's Asset
|
|
74
|
+
* field value looks like. Passed back verbatim as a record field's value to
|
|
75
|
+
* attach an upload to a record; never reconstructed field-by-field, since it
|
|
76
|
+
* is an opaque blob the server itself validates.
|
|
77
|
+
*/
|
|
78
|
+
export interface CloudKitAssetDescriptor {
|
|
79
|
+
fileChecksum: string;
|
|
80
|
+
size: string | number;
|
|
81
|
+
receipt: string;
|
|
82
|
+
referenceChecksum?: string;
|
|
83
|
+
wrappingKey?: string;
|
|
84
|
+
/** Present only when fetching the record that owns this field, not on upload. */
|
|
85
|
+
downloadURL?: string;
|
|
86
|
+
}
|
|
54
87
|
export declare const RECORD_TYPE_DEFAULT = "KVBlob";
|
|
55
88
|
export declare const VALUE_FIELD = "value";
|
|
56
89
|
/** CloudKit's documented per-record ceiling, excluding assets. */
|
|
@@ -68,6 +101,13 @@ export declare class CloudKitRestClient {
|
|
|
68
101
|
* Codes are from Apple's CloudKit Web Services error reference.
|
|
69
102
|
*/
|
|
70
103
|
private toError;
|
|
104
|
+
/**
|
|
105
|
+
* HTTP-status classification for a response with no CloudKit error envelope
|
|
106
|
+
* of its own to inspect - `post()`'s fallback tail, and the raw asset-bytes
|
|
107
|
+
* transfer, which talks to an opaque single-use upload/download URL rather
|
|
108
|
+
* than a `/records/...` JSON endpoint.
|
|
109
|
+
*/
|
|
110
|
+
private classifyHttpStatus;
|
|
71
111
|
private post;
|
|
72
112
|
getRecord(recordName: string, recordType?: string): Promise<string | null>;
|
|
73
113
|
/**
|
|
@@ -109,6 +149,56 @@ export declare class CloudKitRestClient {
|
|
|
109
149
|
/** Deletes many records in one request, with the same per-record rules. */
|
|
110
150
|
deleteRecords(recordNames: string[], recordType?: string): Promise<void>;
|
|
111
151
|
saveRecord(recordName: string, value: string, recordType?: string): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Creates `recordName`, falling back to an unconditional update when it
|
|
154
|
+
* already exists - the create-then-fall-back dance every write after the
|
|
155
|
+
* first one takes. Shared by {@link saveRecord} (a `value` field) and
|
|
156
|
+
* {@link uploadAsset} (an Asset field plus its `__size` sidecar), which need
|
|
157
|
+
* the exact same dance for a different field set.
|
|
158
|
+
*/
|
|
159
|
+
private saveFields;
|
|
160
|
+
/**
|
|
161
|
+
* Uploads `bytes` as `fieldName` on `recordName`, via CloudKit Web Services'
|
|
162
|
+
* asset-upload protocol: request a single-use upload URL, POST the raw bytes
|
|
163
|
+
* to it, then attach the descriptor it returns (plus a `__size` sidecar, so
|
|
164
|
+
* a later {@link fetchAsset} can report real download progress) to the
|
|
165
|
+
* record - the same create-then-update dance {@link saveRecord} uses.
|
|
166
|
+
*
|
|
167
|
+
* `onProgress` reports real bytes transferred, via `XMLHttpRequest` rather
|
|
168
|
+
* than `fetch` - see {@link CloudKitRestConfig.xhrImpl}.
|
|
169
|
+
*/
|
|
170
|
+
uploadAsset(recordName: string, fieldName: string, bytes: Uint8Array, onProgress?: (bytesTransferred: number, bytesTotal: number) => void, recordType?: string): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Downloads the bytes behind `fieldName` on `recordName`, or `null` when the
|
|
173
|
+
* record or the field's asset does not exist.
|
|
174
|
+
*
|
|
175
|
+
* A fetched record's Asset field carries a `downloadURL` - that is the only
|
|
176
|
+
* step this needs beyond the usual record lookup; there is no separate
|
|
177
|
+
* "request a download token" round trip the way upload has one.
|
|
178
|
+
*/
|
|
179
|
+
fetchAsset(recordName: string, fieldName: string, onProgress?: (bytesTransferred: number, bytesTotal: number) => void, recordType?: string): Promise<Uint8Array | null>;
|
|
180
|
+
private requestAssetUploadUrl;
|
|
181
|
+
private get xhr();
|
|
182
|
+
/**
|
|
183
|
+
* POSTs raw bytes to a single-use CKWS asset-upload URL, reporting real
|
|
184
|
+
* upload progress via `XMLHttpRequest.upload.onprogress` - `fetch` exposes no
|
|
185
|
+
* upload-progress events in React Native. Scoped to just this one call:
|
|
186
|
+
* every other CloudKit REST request stays on `fetch` through `post()`, for
|
|
187
|
+
* the timeout/error handling already built there.
|
|
188
|
+
*/
|
|
189
|
+
private putAssetBytes;
|
|
190
|
+
/**
|
|
191
|
+
* GETs raw bytes from a record's asset `downloadURL`, reporting real
|
|
192
|
+
* download progress via `XMLHttpRequest.onprogress`, for the same reason
|
|
193
|
+
* {@link putAssetBytes} uses XHR rather than `fetch`.
|
|
194
|
+
*
|
|
195
|
+
* Treated as self-contained, the same way the upload URL is (Apple's own
|
|
196
|
+
* reference issues that one with no `ckAPIToken`/`ckWebAuthToken` at all) -
|
|
197
|
+
* if that assumption is ever wrong for a download URL specifically, it
|
|
198
|
+
* surfaces as an HTTP-level auth failure here rather than a silent wrong
|
|
199
|
+
* answer.
|
|
200
|
+
*/
|
|
201
|
+
private fetchAssetBytes;
|
|
112
202
|
/**
|
|
113
203
|
* A write that fails instead of clobbering, when the server's copy has moved
|
|
114
204
|
* on since `recordChangeTag` was read.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudKitRest.d.ts","sourceRoot":"","sources":["../../../../src/internal/cloudKitRest.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,mBAAmB,EAAE,MAAM,CAAA;IAC3B;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,aAAa,GAAG,YAAY,CAAA;IACzC,oFAAoF;IACpF,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC1D;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1C,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAWD,eAAO,MAAM,mBAAmB,WAAW,CAAA;AAC3C,eAAO,MAAM,WAAW,UAAU,CAAA;AAElC,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,QAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"cloudKitRest.d.ts","sourceRoot":"","sources":["../../../../src/internal/cloudKitRest.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,mBAAmB,EAAE,MAAM,CAAA;IAC3B;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,aAAa,GAAG,YAAY,CAAA;IACzC,oFAAoF;IACpF,YAAY,EAAE,MAAM,OAAO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;;;;OAMG;IACH,OAAO,CAAC,aAAa;IA8CrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,eAAe;IAoCvB;;;;;;;;;;;;;;OAcG;IACG,qBAAqB,CACzB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,UAAU,SAAsB,GAC/B,OAAO,CAAC,IAAI,CAAC;IAqCV,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,SAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAejF,gBAAgB,CAAC,UAAU,SAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA8B3E;;;;;;;;OAQG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAoBrC;;;;;OAKG;IACH,UAAU,IAAI,IAAI;CAGnB;AAaD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAS,CAAA"}
|
|
@@ -3,8 +3,11 @@ import { type AbortLike } from './timeout.js';
|
|
|
3
3
|
* Google Drive `appDataFolder` REST client.
|
|
4
4
|
*
|
|
5
5
|
* `appDataFolder` is a hidden per-app, per-Google-account folder: nothing shows
|
|
6
|
-
* up in the user's visible Drive, and the data
|
|
7
|
-
*
|
|
6
|
+
* up in the user's visible Drive, and the data is tied to the Google account
|
|
7
|
+
* rather than the device or install, so reinstalling the app or switching
|
|
8
|
+
* devices doesn't lose it. It goes away only if the user disconnects the app
|
|
9
|
+
* from their Drive account or deletes the data folder directly - Google
|
|
10
|
+
* documents both as the ways this folder is actually removed.
|
|
8
11
|
*
|
|
9
12
|
* Auth is deliberately injected rather than owned. The library does not depend
|
|
10
13
|
* on `@react-native-google-signin/google-signin` (or any other sign-in library),
|
|
@@ -52,6 +55,37 @@ export interface GoogleDriveConfig {
|
|
|
52
55
|
* its own, so without this a dead socket hangs the transfer forever.
|
|
53
56
|
*/
|
|
54
57
|
timeoutMs?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Persists `uploadFile`'s resumable-session URI across process restarts.
|
|
60
|
+
*
|
|
61
|
+
* Without this, the session lives only in memory: a process killed mid-upload
|
|
62
|
+
* loses it, and the next `uploadFile` for the same name starts over from byte
|
|
63
|
+
* 0 even though Drive still has the bytes already accepted. With it, the next
|
|
64
|
+
* call finds the persisted session, asks Drive for the real offset, and
|
|
65
|
+
* resumes from there instead.
|
|
66
|
+
*
|
|
67
|
+
* A tiny JSON record, not file I/O - back it with AsyncStorage, MMKV, or a
|
|
68
|
+
* single row in whatever the host app already uses. Optional; omitting it
|
|
69
|
+
* keeps today's in-memory-only behaviour.
|
|
70
|
+
*/
|
|
71
|
+
sessionStore?: GoogleDriveSessionStore;
|
|
72
|
+
}
|
|
73
|
+
/** What `uploadFile` needs to resume a resumable-upload session later. */
|
|
74
|
+
export interface GoogleDriveUploadSession {
|
|
75
|
+
sessionUrl: string;
|
|
76
|
+
/** The source size the session was started against - resuming into a file
|
|
77
|
+
* that has since changed size would corrupt it, so a mismatch is treated
|
|
78
|
+
* as "start fresh" rather than resumed. */
|
|
79
|
+
size: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Host-supplied persistence for in-flight `uploadFile` sessions, keyed by the
|
|
83
|
+
* Drive file name. See {@link GoogleDriveConfig.sessionStore}.
|
|
84
|
+
*/
|
|
85
|
+
export interface GoogleDriveSessionStore {
|
|
86
|
+
get: (name: string) => Promise<GoogleDriveUploadSession | null>;
|
|
87
|
+
set: (name: string, session: GoogleDriveUploadSession) => Promise<void>;
|
|
88
|
+
remove: (name: string) => Promise<void>;
|
|
55
89
|
}
|
|
56
90
|
/** A local file `uploadFile` reads from, in fixed-size pieces. */
|
|
57
91
|
export interface DriveChunkSource {
|
|
@@ -114,6 +148,14 @@ export declare class GoogleDriveClient {
|
|
|
114
148
|
* caller inspects the response itself rather than getting a thrown rejection.
|
|
115
149
|
*/
|
|
116
150
|
private request;
|
|
151
|
+
/**
|
|
152
|
+
* Best-effort read of Drive's `error.errors[0].reason` from a failed
|
|
153
|
+
* response body - the only way a 403 status distinguishes an invalid token
|
|
154
|
+
* from quota-exceeded from a rate limit. Returns undefined for a body that
|
|
155
|
+
* is missing, unparseable, or doesn't carry the shape Drive documents,
|
|
156
|
+
* rather than throwing a second error while already handling one.
|
|
157
|
+
*/
|
|
158
|
+
private driveErrorReason;
|
|
117
159
|
/**
|
|
118
160
|
* Resolves a file name to its id within appDataFolder, or null if absent.
|
|
119
161
|
*
|
|
@@ -171,18 +213,41 @@ export declare class GoogleDriveClient {
|
|
|
171
213
|
* how many bytes it actually has and resuming from there - rather than
|
|
172
214
|
* restarting the transfer.
|
|
173
215
|
*
|
|
174
|
-
* That resumability
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
216
|
+
* That resumability spans a process restart too, when {@link
|
|
217
|
+
* GoogleDriveConfig.sessionStore} is configured: the session URI is persisted
|
|
218
|
+
* before the first chunk goes out, and a later `uploadFile` for the same name
|
|
219
|
+
* finds it, asks Drive for the real offset, and resumes from there instead of
|
|
220
|
+
* byte 0. Without a `sessionStore`, the session lives only in memory, exactly
|
|
221
|
+
* as before - a process that dies mid-upload loses it, and the next call
|
|
222
|
+
* starts fresh.
|
|
179
223
|
*/
|
|
180
224
|
uploadFile(name: string, source: DriveChunkSource, onProgress?: (bytesTransferred: number, bytesTotal: number) => void, signal?: AbortLike): Promise<void>;
|
|
225
|
+
/**
|
|
226
|
+
* Finds an existing session to resume, or starts a new one.
|
|
227
|
+
*
|
|
228
|
+
* A persisted session is trusted only when its recorded size still matches
|
|
229
|
+
* `total` - resuming a byte-range PUT into a file that has since changed
|
|
230
|
+
* would corrupt it, so a mismatch is treated the same as no session at all.
|
|
231
|
+
* A persisted session Drive no longer recognises (expired, or the upload id
|
|
232
|
+
* was never valid) is also treated as absent: `queryUploadOffset` failing is
|
|
233
|
+
* the signal, since there is no cheaper way to ask than trying to use it.
|
|
234
|
+
*/
|
|
235
|
+
private resumeOrStartSession;
|
|
181
236
|
private startResumableSession;
|
|
182
237
|
/** One chunk, with a single retry that re-queries the server's real offset first. */
|
|
183
238
|
private putChunkWithRetry;
|
|
184
239
|
private putChunk;
|
|
185
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* Asks Drive how much of an in-flight resumable session it actually has, or
|
|
242
|
+
* discovers the upload was already complete server-side - the completing
|
|
243
|
+
* chunk's own response can be lost the same way any other one can, and this
|
|
244
|
+
* status check gets the same completion response back in that case,
|
|
245
|
+
* `id` included.
|
|
246
|
+
*
|
|
247
|
+
* Throws (via `request`) when `sessionUrl` is not a session Drive
|
|
248
|
+
* recognises any more - expired, or never valid. Callers treat that as the
|
|
249
|
+
* signal to stop trusting it, since there is no cheaper way to ask.
|
|
250
|
+
*/
|
|
186
251
|
private queryUploadOffset;
|
|
187
252
|
/**
|
|
188
253
|
* Downloads `name` into `sink`, in the same fixed-size chunks `uploadFile`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"googleDriveRest.d.ts","sourceRoot":"","sources":["../../../../src/internal/googleDriveRest.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,cAAW,CAAA;AAEvE
|
|
1
|
+
{"version":3,"file":"googleDriveRest.d.ts","sourceRoot":"","sources":["../../../../src/internal/googleDriveRest.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,cAAW,CAAA;AAEvE;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;;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