react-native-cloud-sync 0.1.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/LICENSE +21 -0
- package/README.md +360 -0
- package/app.plugin.js +3 -0
- package/ios/CloudSyncError.swift +144 -0
- package/ios/CloudSyncImpl.swift +1263 -0
- package/ios/RNCloudSync.h +25 -0
- package/ios/RNCloudSync.mm +477 -0
- package/jest-mock.js +136 -0
- package/lib/commonjs/config.js +85 -0
- package/lib/commonjs/config.js.map +1 -0
- package/lib/commonjs/errors.js +244 -0
- package/lib/commonjs/errors.js.map +1 -0
- package/lib/commonjs/hooks.js +257 -0
- package/lib/commonjs/hooks.js.map +1 -0
- package/lib/commonjs/index.js +244 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/internal/autoFlush.js +65 -0
- package/lib/commonjs/internal/autoFlush.js.map +1 -0
- package/lib/commonjs/internal/base64.js +58 -0
- package/lib/commonjs/internal/base64.js.map +1 -0
- package/lib/commonjs/internal/bytes.js +32 -0
- package/lib/commonjs/internal/bytes.js.map +1 -0
- package/lib/commonjs/internal/cloudKitRest.js +527 -0
- package/lib/commonjs/internal/cloudKitRest.js.map +1 -0
- package/lib/commonjs/internal/enums.js +23 -0
- package/lib/commonjs/internal/enums.js.map +1 -0
- package/lib/commonjs/internal/googleDriveRest.js +624 -0
- package/lib/commonjs/internal/googleDriveRest.js.map +1 -0
- package/lib/commonjs/internal/keys.js +139 -0
- package/lib/commonjs/internal/keys.js.map +1 -0
- package/lib/commonjs/internal/logger.js +29 -0
- package/lib/commonjs/internal/logger.js.map +1 -0
- package/lib/commonjs/internal/nativeModule.js +125 -0
- package/lib/commonjs/internal/nativeModule.js.map +1 -0
- package/lib/commonjs/internal/timeout.js +72 -0
- package/lib/commonjs/internal/timeout.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/providers/cloudKit.js +398 -0
- package/lib/commonjs/providers/cloudKit.js.map +1 -0
- package/lib/commonjs/providers/cloudKitBackup.js +86 -0
- package/lib/commonjs/providers/cloudKitBackup.js.map +1 -0
- package/lib/commonjs/providers/cloudKitEncrypted.js +150 -0
- package/lib/commonjs/providers/cloudKitEncrypted.js.map +1 -0
- package/lib/commonjs/providers/googleDrive.js +219 -0
- package/lib/commonjs/providers/googleDrive.js.map +1 -0
- package/lib/commonjs/providers/googleDriveFiles.js +68 -0
- package/lib/commonjs/providers/googleDriveFiles.js.map +1 -0
- package/lib/commonjs/providers/icloudDocuments.js +121 -0
- package/lib/commonjs/providers/icloudDocuments.js.map +1 -0
- package/lib/commonjs/providers/icloudKV.js +171 -0
- package/lib/commonjs/providers/icloudKV.js.map +1 -0
- package/lib/commonjs/providers/icloudKV.web.js +42 -0
- package/lib/commonjs/providers/icloudKV.web.js.map +1 -0
- package/lib/commonjs/providers/memory.js +201 -0
- package/lib/commonjs/providers/memory.js.map +1 -0
- package/lib/commonjs/resolvers.js +128 -0
- package/lib/commonjs/resolvers.js.map +1 -0
- package/lib/commonjs/specs/NativeRNCloudSync.js +14 -0
- package/lib/commonjs/specs/NativeRNCloudSync.js.map +1 -0
- package/lib/commonjs/store.js +1064 -0
- package/lib/commonjs/store.js.map +1 -0
- package/lib/commonjs/testing.js +32 -0
- package/lib/commonjs/testing.js.map +1 -0
- package/lib/commonjs/types.js +86 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/config.js +72 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/errors.js +231 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/hooks.js +250 -0
- package/lib/module/hooks.js.map +1 -0
- package/lib/module/index.js +46 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/autoFlush.js +62 -0
- package/lib/module/internal/autoFlush.js.map +1 -0
- package/lib/module/internal/base64.js +53 -0
- package/lib/module/internal/base64.js.map +1 -0
- package/lib/module/internal/bytes.js +28 -0
- package/lib/module/internal/bytes.js.map +1 -0
- package/lib/module/internal/cloudKitRest.js +518 -0
- package/lib/module/internal/cloudKitRest.js.map +1 -0
- package/lib/module/internal/enums.js +18 -0
- package/lib/module/internal/enums.js.map +1 -0
- package/lib/module/internal/googleDriveRest.js +620 -0
- package/lib/module/internal/googleDriveRest.js.map +1 -0
- package/lib/module/internal/keys.js +134 -0
- package/lib/module/internal/keys.js.map +1 -0
- package/lib/module/internal/logger.js +23 -0
- package/lib/module/internal/logger.js.map +1 -0
- package/lib/module/internal/nativeModule.js +117 -0
- package/lib/module/internal/nativeModule.js.map +1 -0
- package/lib/module/internal/timeout.js +67 -0
- package/lib/module/internal/timeout.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/providers/cloudKit.js +392 -0
- package/lib/module/providers/cloudKit.js.map +1 -0
- package/lib/module/providers/cloudKitBackup.js +82 -0
- package/lib/module/providers/cloudKitBackup.js.map +1 -0
- package/lib/module/providers/cloudKitEncrypted.js +146 -0
- package/lib/module/providers/cloudKitEncrypted.js.map +1 -0
- package/lib/module/providers/googleDrive.js +214 -0
- package/lib/module/providers/googleDrive.js.map +1 -0
- package/lib/module/providers/googleDriveFiles.js +64 -0
- package/lib/module/providers/googleDriveFiles.js.map +1 -0
- package/lib/module/providers/icloudDocuments.js +117 -0
- package/lib/module/providers/icloudDocuments.js.map +1 -0
- package/lib/module/providers/icloudKV.js +165 -0
- package/lib/module/providers/icloudKV.js.map +1 -0
- package/lib/module/providers/icloudKV.web.js +36 -0
- package/lib/module/providers/icloudKV.web.js.map +1 -0
- package/lib/module/providers/memory.js +197 -0
- package/lib/module/providers/memory.js.map +1 -0
- package/lib/module/resolvers.js +120 -0
- package/lib/module/resolvers.js.map +1 -0
- package/lib/module/specs/NativeRNCloudSync.js +12 -0
- package/lib/module/specs/NativeRNCloudSync.js.map +1 -0
- package/lib/module/store.js +1061 -0
- package/lib/module/store.js.map +1 -0
- package/lib/module/testing.js +17 -0
- package/lib/module/testing.js.map +1 -0
- package/lib/module/types.js +82 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/commonjs/config.d.ts +33 -0
- package/lib/typescript/commonjs/config.d.ts.map +1 -0
- package/lib/typescript/commonjs/errors.d.ts +140 -0
- package/lib/typescript/commonjs/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks.d.ts +109 -0
- package/lib/typescript/commonjs/hooks.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +37 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/autoFlush.d.ts +45 -0
- package/lib/typescript/commonjs/internal/autoFlush.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/base64.d.ts +12 -0
- package/lib/typescript/commonjs/internal/base64.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/bytes.d.ts +12 -0
- package/lib/typescript/commonjs/internal/bytes.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/cloudKitRest.d.ts +149 -0
- package/lib/typescript/commonjs/internal/cloudKitRest.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/enums.d.ts +10 -0
- package/lib/typescript/commonjs/internal/enums.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/googleDriveRest.d.ts +232 -0
- package/lib/typescript/commonjs/internal/googleDriveRest.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/keys.d.ts +28 -0
- package/lib/typescript/commonjs/internal/keys.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/logger.d.ts +10 -0
- package/lib/typescript/commonjs/internal/logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/nativeModule.d.ts +29 -0
- package/lib/typescript/commonjs/internal/nativeModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/timeout.d.ts +36 -0
- package/lib/typescript/commonjs/internal/timeout.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/providers/cloudKit.d.ts +86 -0
- package/lib/typescript/commonjs/providers/cloudKit.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/cloudKitBackup.d.ts +65 -0
- package/lib/typescript/commonjs/providers/cloudKitBackup.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/cloudKitEncrypted.d.ts +37 -0
- package/lib/typescript/commonjs/providers/cloudKitEncrypted.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/googleDrive.d.ts +35 -0
- package/lib/typescript/commonjs/providers/googleDrive.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/googleDriveFiles.d.ts +59 -0
- package/lib/typescript/commonjs/providers/googleDriveFiles.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/icloudDocuments.d.ts +101 -0
- package/lib/typescript/commonjs/providers/icloudDocuments.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/icloudKV.d.ts +26 -0
- package/lib/typescript/commonjs/providers/icloudKV.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/icloudKV.web.d.ts +12 -0
- package/lib/typescript/commonjs/providers/icloudKV.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/providers/memory.d.ts +90 -0
- package/lib/typescript/commonjs/providers/memory.d.ts.map +1 -0
- package/lib/typescript/commonjs/resolvers.d.ts +60 -0
- package/lib/typescript/commonjs/resolvers.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/NativeRNCloudSync.d.ts +133 -0
- package/lib/typescript/commonjs/specs/NativeRNCloudSync.d.ts.map +1 -0
- package/lib/typescript/commonjs/store.d.ts +118 -0
- package/lib/typescript/commonjs/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing.d.ts +16 -0
- package/lib/typescript/commonjs/testing.d.ts.map +1 -0
- package/lib/typescript/commonjs/types.d.ts +367 -0
- package/lib/typescript/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/module/config.d.ts +33 -0
- package/lib/typescript/module/config.d.ts.map +1 -0
- package/lib/typescript/module/errors.d.ts +140 -0
- package/lib/typescript/module/errors.d.ts.map +1 -0
- package/lib/typescript/module/hooks.d.ts +109 -0
- package/lib/typescript/module/hooks.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +37 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/internal/autoFlush.d.ts +45 -0
- package/lib/typescript/module/internal/autoFlush.d.ts.map +1 -0
- package/lib/typescript/module/internal/base64.d.ts +12 -0
- package/lib/typescript/module/internal/base64.d.ts.map +1 -0
- package/lib/typescript/module/internal/bytes.d.ts +12 -0
- package/lib/typescript/module/internal/bytes.d.ts.map +1 -0
- package/lib/typescript/module/internal/cloudKitRest.d.ts +149 -0
- package/lib/typescript/module/internal/cloudKitRest.d.ts.map +1 -0
- package/lib/typescript/module/internal/enums.d.ts +10 -0
- package/lib/typescript/module/internal/enums.d.ts.map +1 -0
- package/lib/typescript/module/internal/googleDriveRest.d.ts +232 -0
- package/lib/typescript/module/internal/googleDriveRest.d.ts.map +1 -0
- package/lib/typescript/module/internal/keys.d.ts +28 -0
- package/lib/typescript/module/internal/keys.d.ts.map +1 -0
- package/lib/typescript/module/internal/logger.d.ts +10 -0
- package/lib/typescript/module/internal/logger.d.ts.map +1 -0
- package/lib/typescript/module/internal/nativeModule.d.ts +29 -0
- package/lib/typescript/module/internal/nativeModule.d.ts.map +1 -0
- package/lib/typescript/module/internal/timeout.d.ts +36 -0
- package/lib/typescript/module/internal/timeout.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/providers/cloudKit.d.ts +86 -0
- package/lib/typescript/module/providers/cloudKit.d.ts.map +1 -0
- package/lib/typescript/module/providers/cloudKitBackup.d.ts +65 -0
- package/lib/typescript/module/providers/cloudKitBackup.d.ts.map +1 -0
- package/lib/typescript/module/providers/cloudKitEncrypted.d.ts +37 -0
- package/lib/typescript/module/providers/cloudKitEncrypted.d.ts.map +1 -0
- package/lib/typescript/module/providers/googleDrive.d.ts +35 -0
- package/lib/typescript/module/providers/googleDrive.d.ts.map +1 -0
- package/lib/typescript/module/providers/googleDriveFiles.d.ts +59 -0
- package/lib/typescript/module/providers/googleDriveFiles.d.ts.map +1 -0
- package/lib/typescript/module/providers/icloudDocuments.d.ts +101 -0
- package/lib/typescript/module/providers/icloudDocuments.d.ts.map +1 -0
- package/lib/typescript/module/providers/icloudKV.d.ts +26 -0
- package/lib/typescript/module/providers/icloudKV.d.ts.map +1 -0
- package/lib/typescript/module/providers/icloudKV.web.d.ts +12 -0
- package/lib/typescript/module/providers/icloudKV.web.d.ts.map +1 -0
- package/lib/typescript/module/providers/memory.d.ts +90 -0
- package/lib/typescript/module/providers/memory.d.ts.map +1 -0
- package/lib/typescript/module/resolvers.d.ts +60 -0
- package/lib/typescript/module/resolvers.d.ts.map +1 -0
- package/lib/typescript/module/specs/NativeRNCloudSync.d.ts +133 -0
- package/lib/typescript/module/specs/NativeRNCloudSync.d.ts.map +1 -0
- package/lib/typescript/module/store.d.ts +118 -0
- package/lib/typescript/module/store.d.ts.map +1 -0
- package/lib/typescript/module/testing.d.ts +16 -0
- package/lib/typescript/module/testing.d.ts.map +1 -0
- package/lib/typescript/module/types.d.ts +367 -0
- package/lib/typescript/module/types.d.ts.map +1 -0
- package/package.json +186 -0
- package/plugin/build/index.d.ts +45 -0
- package/plugin/build/index.js +93 -0
- package/react-native-cloud-sync.podspec +48 -0
- package/src/config.ts +94 -0
- package/src/errors.ts +263 -0
- package/src/hooks.ts +337 -0
- package/src/index.ts +113 -0
- package/src/internal/autoFlush.ts +87 -0
- package/src/internal/base64.ts +63 -0
- package/src/internal/bytes.ts +28 -0
- package/src/internal/cloudKitRest.ts +654 -0
- package/src/internal/enums.ts +35 -0
- package/src/internal/googleDriveRest.ts +765 -0
- package/src/internal/keys.ts +160 -0
- package/src/internal/logger.ts +23 -0
- package/src/internal/nativeModule.ts +149 -0
- package/src/internal/timeout.ts +83 -0
- package/src/providers/cloudKit.ts +510 -0
- package/src/providers/cloudKitBackup.ts +124 -0
- package/src/providers/cloudKitEncrypted.ts +175 -0
- package/src/providers/googleDrive.ts +251 -0
- package/src/providers/googleDriveFiles.ts +117 -0
- package/src/providers/icloudDocuments.ts +175 -0
- package/src/providers/icloudKV.ts +206 -0
- package/src/providers/icloudKV.web.ts +41 -0
- package/src/providers/memory.ts +302 -0
- package/src/resolvers.ts +133 -0
- package/src/specs/NativeRNCloudSync.ts +184 -0
- package/src/store.ts +1288 -0
- package/src/testing.ts +22 -0
- package/src/types.ts +426 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Codegen cannot express an index signature, so dynamic dictionaries cross the
|
|
5
|
+
* bridge as `UnsafeObject`. Same workaround react-native-background-downloader
|
|
6
|
+
* uses for its header maps.
|
|
7
|
+
*/
|
|
8
|
+
export type UnsafeObject = {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
export type RemoteChangeNativeEvent = {
|
|
12
|
+
keys: string[];
|
|
13
|
+
/** One of ChangeReason. Kept as a plain string - codegen has no string unions. */
|
|
14
|
+
reason: string;
|
|
15
|
+
provider: string;
|
|
16
|
+
};
|
|
17
|
+
export type AccountChangeNativeEvent = {
|
|
18
|
+
/** One of AccountStatus. */
|
|
19
|
+
status: string;
|
|
20
|
+
identityChanged: boolean;
|
|
21
|
+
provider: string;
|
|
22
|
+
};
|
|
23
|
+
export type DocumentEntryNativeEvent = {
|
|
24
|
+
name: string;
|
|
25
|
+
sizeBytes: number;
|
|
26
|
+
/** False when the file exists in the account but has no local copy yet. */
|
|
27
|
+
isDownloaded: boolean;
|
|
28
|
+
isDownloading: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type AssetProgressNativeEvent = {
|
|
31
|
+
recordName: string;
|
|
32
|
+
fieldName: string;
|
|
33
|
+
bytesTransferred: number;
|
|
34
|
+
bytesTotal: number;
|
|
35
|
+
};
|
|
36
|
+
export interface Spec extends TurboModule {
|
|
37
|
+
getConstants: () => {
|
|
38
|
+
/** The iCloud container id resolved from entitlements, or '' if unset. */
|
|
39
|
+
containerIdentifier: string;
|
|
40
|
+
/** True when the build carries an iCloud entitlement at all. */
|
|
41
|
+
hasICloudEntitlement: boolean;
|
|
42
|
+
};
|
|
43
|
+
getAccountStatus: () => Promise<string>;
|
|
44
|
+
isAvailable: () => Promise<boolean>;
|
|
45
|
+
kvGetItem: (key: string) => Promise<string | null>;
|
|
46
|
+
kvSetItem: (key: string, value: string) => Promise<void>;
|
|
47
|
+
kvRemoveItem: (key: string) => Promise<void>;
|
|
48
|
+
kvGetAllKeys: () => Promise<string[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Every key and value at once - one bridge hop where `kvGetAllKeys` plus N
|
|
51
|
+
* `kvGetItem` calls would be N+1. Non-string values are omitted rather than
|
|
52
|
+
* coerced, since a stringified number would not round-trip through
|
|
53
|
+
* `kvSetItem`.
|
|
54
|
+
*/
|
|
55
|
+
kvGetAllItems: () => Promise<UnsafeObject>;
|
|
56
|
+
/**
|
|
57
|
+
* Flushes pending KV changes to disk.
|
|
58
|
+
*
|
|
59
|
+
* Note this is `NSUbiquitousKeyValueStore.synchronize()`, which despite the
|
|
60
|
+
* name does NOT confirm a server round trip - it only schedules the upload.
|
|
61
|
+
* Callers must not treat a resolved `kvSync()` as "the cloud has my data".
|
|
62
|
+
*/
|
|
63
|
+
kvSync: () => Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* How full the key-value store is, against Apple's documented ceilings.
|
|
66
|
+
*
|
|
67
|
+
* Measured from `dictionaryRepresentation` (a local plist, not a network
|
|
68
|
+
* call) because Apple exposes no usage API. Without it an app can only learn
|
|
69
|
+
* it is near the 1 MB *total* by exceeding it, and exceeding it is silent.
|
|
70
|
+
*/
|
|
71
|
+
kvGetUsage: () => Promise<{
|
|
72
|
+
usedBytes: number;
|
|
73
|
+
totalBytes: number;
|
|
74
|
+
keyCount: number;
|
|
75
|
+
maxKeys: number;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* `encrypted` reads the value out of `CKRecord.encryptedValues` rather than
|
|
79
|
+
* the plain field. A field is one or the other, never both - CloudKit records
|
|
80
|
+
* encryption in the schema - so reading the wrong side returns null, which is
|
|
81
|
+
* indistinguishable from a missing record.
|
|
82
|
+
*/
|
|
83
|
+
ckGetRecord: (recordType: string, recordName: string, zoneName: string | null, encrypted: boolean) => Promise<string | null>;
|
|
84
|
+
/**
|
|
85
|
+
* `encrypted` writes through `CKRecord.encryptedValues`, so CloudKit
|
|
86
|
+
* end-to-end encrypts the value with a key from the user's iCloud Keychain.
|
|
87
|
+
* Nothing server-side can read it back - including CloudKit Web Services, and
|
|
88
|
+
* therefore this package's Android and web paths.
|
|
89
|
+
*/
|
|
90
|
+
ckSaveRecord: (recordType: string, recordName: string, value: string, zoneName: string | null, encrypted: boolean) => Promise<void>;
|
|
91
|
+
ckDeleteRecord: (recordName: string, zoneName: string | null) => Promise<boolean>;
|
|
92
|
+
ckQueryRecordNames: (recordType: string, zoneName: string | null) => Promise<string[]>;
|
|
93
|
+
ckCreateZone: (zoneName: string) => Promise<void>;
|
|
94
|
+
ckDeleteZone: (zoneName: string) => Promise<void>;
|
|
95
|
+
ckListZones: () => Promise<string[]>;
|
|
96
|
+
/** Uploads a local file as a CKAsset field. Emits `onAssetProgress` while running. */
|
|
97
|
+
ckSaveAsset: (recordType: string, recordName: string, fieldName: string, fileUri: string, zoneName: string | null) => Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Downloads a CKAsset field. Emits `onAssetProgress` while running.
|
|
100
|
+
*
|
|
101
|
+
* `destinationUri` is where the bytes land; null picks a temporary path.
|
|
102
|
+
* Worth passing for anything the user keeps or hands to a share sheet - the
|
|
103
|
+
* default is in `NSTemporaryDirectory`, which iOS may reclaim.
|
|
104
|
+
*/
|
|
105
|
+
ckFetchAsset: (recordName: string, fieldName: string, zoneName: string | null, destinationUri: string | null) => Promise<string | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Cancels an in-flight asset transfer. Resolves true when there was one.
|
|
108
|
+
*
|
|
109
|
+
* The cancelled call's own promise rejects with `ERR_CANCELLED` - CloudKit
|
|
110
|
+
* reports the cancellation as `CKError.operationCancelled`, which the error
|
|
111
|
+
* mapper already recognises.
|
|
112
|
+
*/
|
|
113
|
+
ckCancelAsset: (recordName: string, fieldName: string) => Promise<boolean>;
|
|
114
|
+
/** Whether a usable iCloud Drive container exists on this device right now. */
|
|
115
|
+
docIsAvailable: () => Promise<boolean>;
|
|
116
|
+
/** Copies a local file into iCloud Drive under `name`. Resolves its iCloud path. */
|
|
117
|
+
docSave: (fileUri: string, name: string) => Promise<string>;
|
|
118
|
+
/**
|
|
119
|
+
* Ensures `name` has been downloaded and resolves a local path, or null when
|
|
120
|
+
* no such file exists. Copies out to `destinationUri` when one is given.
|
|
121
|
+
*/
|
|
122
|
+
docFetch: (name: string, destinationUri: string | null, timeoutMs: number) => Promise<string | null>;
|
|
123
|
+
docList: () => Promise<DocumentEntryNativeEvent[]>;
|
|
124
|
+
/** Resolves true when something was deleted, false when it was already gone. */
|
|
125
|
+
docRemove: (name: string) => Promise<boolean>;
|
|
126
|
+
readonly onRemoteChange: EventEmitter<RemoteChangeNativeEvent>;
|
|
127
|
+
readonly onAccountChange: EventEmitter<AccountChangeNativeEvent>;
|
|
128
|
+
readonly onAssetProgress: EventEmitter<AssetProgressNativeEvent>;
|
|
129
|
+
setLogsEnabled: (enabled: boolean) => void;
|
|
130
|
+
}
|
|
131
|
+
declare const _default: Spec | null;
|
|
132
|
+
export default _default;
|
|
133
|
+
//# sourceMappingURL=NativeRNCloudSync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeRNCloudSync.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeRNCloudSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AAE7E;;;;GAIG;AACH,MAAM,MAAM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Q,CAAC,eAAe,EAAE,YAAY,CAAC,wBAAwB,CAAC,CAAA;IAIhE,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C;;AAED,wBAA2D"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { CloudSyncError } from './errors';
|
|
2
|
+
import { type AccountChangeEvent, type CloudProvider, type CloudStoreOptions, type DroppedWrite, type OutboxEntry, type ProviderName, type QuotaInfo, type RemoteChangeEvent, type Unsubscribe } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A durable place to park failed writes.
|
|
5
|
+
*
|
|
6
|
+
* Defaults to memory, which is honest but loses the queue on app restart. Pass
|
|
7
|
+
* an MMKV-backed adapter in production so an offline write survives being
|
|
8
|
+
* killed - that is the whole point of the outbox.
|
|
9
|
+
*
|
|
10
|
+
* Both methods are synchronous: the outbox is read and rewritten on the write
|
|
11
|
+
* path, where there is nowhere to await. AsyncStorage therefore cannot be
|
|
12
|
+
* wrapped directly; keep a synchronous cache in front of it if that is the
|
|
13
|
+
* only store you have.
|
|
14
|
+
*/
|
|
15
|
+
export interface OutboxStorage {
|
|
16
|
+
getString: (key: string) => string | null | undefined;
|
|
17
|
+
set: (key: string, value: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface MigrateOptions {
|
|
20
|
+
from: ProviderName;
|
|
21
|
+
to: ProviderName;
|
|
22
|
+
/**
|
|
23
|
+
* Keep going when a single key fails instead of aborting the whole
|
|
24
|
+
* migration. Default true.
|
|
25
|
+
*
|
|
26
|
+
* A serial loop that throws on the first bad key leaves the user half
|
|
27
|
+
* migrated with no record of how far it got, which is the worst of both
|
|
28
|
+
* outcomes. The failures come back in the result instead.
|
|
29
|
+
*/
|
|
30
|
+
continueOnError?: boolean;
|
|
31
|
+
/** Only migrate keys this returns true for. */
|
|
32
|
+
filter?: (key: string) => boolean;
|
|
33
|
+
/** Called after each key, for a progress bar over a long migration. */
|
|
34
|
+
onProgress?: (done: number, total: number) => void;
|
|
35
|
+
}
|
|
36
|
+
export interface MigrateResult {
|
|
37
|
+
copied: string[];
|
|
38
|
+
/** Keys that held no value at the source and so had nothing to copy. */
|
|
39
|
+
skipped: string[];
|
|
40
|
+
/** Keys that could not be copied, with the reason for each. */
|
|
41
|
+
failed: {
|
|
42
|
+
key: string;
|
|
43
|
+
error: CloudSyncError;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
46
|
+
export interface FlushResult {
|
|
47
|
+
drained: number;
|
|
48
|
+
remaining: number;
|
|
49
|
+
/** Entries abandoned during this flush. Also reported through `onDropped`. */
|
|
50
|
+
dropped: DroppedWrite[];
|
|
51
|
+
}
|
|
52
|
+
export interface CloudStore {
|
|
53
|
+
getItem: (key: string) => Promise<string | null>;
|
|
54
|
+
setItem: (key: string, value: string) => Promise<void>;
|
|
55
|
+
removeItem: (key: string) => Promise<void>;
|
|
56
|
+
getAllKeys: () => Promise<string[]>;
|
|
57
|
+
/** Reads many keys, batching per provider where the provider supports it. */
|
|
58
|
+
multiGet: (keys: string[]) => Promise<[string, string | null][]>;
|
|
59
|
+
/** Writes many pairs, batching per destination. */
|
|
60
|
+
multiSet: (entries: [string, string][]) => Promise<void>;
|
|
61
|
+
/** Removes many keys, batching per provider. */
|
|
62
|
+
multiRemove: (keys: string[]) => Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Removes every key this store can see. Enumerated, not hardcoded - a
|
|
65
|
+
* "delete my data" flow that forgets a key has not deleted the user's data.
|
|
66
|
+
*/
|
|
67
|
+
clear: () => Promise<{
|
|
68
|
+
removed: string[];
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Every key and value the store can see, as one object.
|
|
72
|
+
*
|
|
73
|
+
* `getAllKeys()` followed by `multiGet()`, so it costs whatever those cost -
|
|
74
|
+
* one batched request per provider that batches, a loop where one does not.
|
|
75
|
+
* Here because it is the shape a debug screen or an export actually wants,
|
|
76
|
+
* and because every key-value library being migrated from has it.
|
|
77
|
+
*/
|
|
78
|
+
getAllItems: () => Promise<Record<string, string>>;
|
|
79
|
+
/** Per-provider storage usage, for the providers that report it. */
|
|
80
|
+
getQuota: () => Promise<QuotaInfo[]>;
|
|
81
|
+
/** Copies every key from one provider to another. Does not delete the source. */
|
|
82
|
+
migrate: (opts: MigrateOptions) => Promise<MigrateResult>;
|
|
83
|
+
/** Attempts to drain queued writes. Safe to call on reconnect or foreground. */
|
|
84
|
+
flushOutbox: () => Promise<FlushResult>;
|
|
85
|
+
/** Entries still waiting, for surfacing a "pending sync" indicator. */
|
|
86
|
+
pendingWrites: () => OutboxEntry[];
|
|
87
|
+
/**
|
|
88
|
+
* Abandons queued writes, optionally only those matching `filter`. Returns
|
|
89
|
+
* how many were removed.
|
|
90
|
+
*
|
|
91
|
+
* The counterpart to `pendingWrites()`: a UI that can show a stuck write
|
|
92
|
+
* should be able to let the user give up on it.
|
|
93
|
+
*/
|
|
94
|
+
discardPendingWrites: (filter?: (e: OutboxEntry) => boolean) => number;
|
|
95
|
+
/** Registers an extra provider (e.g. the in-memory test double). */
|
|
96
|
+
registerProvider: (provider: CloudProvider) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Remote-change events from every configured provider, merged.
|
|
99
|
+
*
|
|
100
|
+
* Previously only the raw providers exposed this, so the facade - the
|
|
101
|
+
* recommended entry point - could not be subscribed to at all.
|
|
102
|
+
*/
|
|
103
|
+
onRemoteChange: (listener: (e: RemoteChangeEvent) => void) => Unsubscribe;
|
|
104
|
+
/**
|
|
105
|
+
* Account-change events from every configured provider, merged.
|
|
106
|
+
*
|
|
107
|
+
* The store also acts on these itself: an `identityChanged` event drops
|
|
108
|
+
* provider caches and abandons queued writes, because both belong to the
|
|
109
|
+
* account that just went away.
|
|
110
|
+
*/
|
|
111
|
+
onAccountChange: (listener: (e: AccountChangeEvent) => void) => Unsubscribe;
|
|
112
|
+
/** Releases the store's own provider subscriptions. */
|
|
113
|
+
dispose: () => void;
|
|
114
|
+
}
|
|
115
|
+
export declare function createCloudStore(options: CloudStoreOptions & {
|
|
116
|
+
outboxStorage?: OutboxStorage;
|
|
117
|
+
}): CloudStore;
|
|
118
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAA0C,MAAM,UAAU,CAAA;AACjF,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,iBAAiB,EAGtB,KAAK,WAAW,EAEjB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACrD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1C;AAgCD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAA;IAClB,EAAE,EAAE,YAAY,CAAA;IAChB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;IACjC,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,wEAAwE;IACxE,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,+DAA+D;IAC/D,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,cAAc,CAAA;KA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OAAO,CAAC,aAAa,CAAC,CAAA;IAEzD,gFAAgF;IAChF,WAAW,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;IACvC,uEAAuE;IACvE,aAAa,EAAE,MAAM,WAAW,EAAE,CAAA;IAClC;;;;;;OAMG;IACH,oBAAoB,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,OAAO,KAAK,MAAM,CAAA;IAEtE,oEAAoE;IACpE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAA;IAEnD;;;;;OAKG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,KAAK,WAAW,CAAA;IACzE;;;;;;OAMG;IACH,eAAe,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,KAAK,WAAW,CAAA;IAE3E,uDAAuD;IACvD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GAAG;IAAE,aAAa,CAAC,EAAE,aAAa,CAAA;CAAE,GAC7D,UAAU,CA4kCZ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test utilities.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately a real package entry point:
|
|
5
|
+
*
|
|
6
|
+
* import { createMemoryProvider } from 'react-native-cloud-sync/testing'
|
|
7
|
+
*
|
|
8
|
+
* expo-cloudkit ships a comparable mock factory but never exports it from the
|
|
9
|
+
* package (its own source says "Import them directly from 'expo-cloudkit/src/testing'
|
|
10
|
+
* in test environments only") and never mentions it in the README - so in
|
|
11
|
+
* practice nobody finds it. An untested testing helper is not a testing story.
|
|
12
|
+
*/
|
|
13
|
+
export { createMemoryProvider, type Fault, type FaultOp, type MemoryProvider, type MemoryProviderOptions } from './providers/memory';
|
|
14
|
+
export { ErrorCode, CloudSyncError, isCloudSyncError } from './errors';
|
|
15
|
+
export type { AccountStatus, ChangeReason, CloudProvider } from './types';
|
|
16
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,oBAAoB,EACpB,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACtE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import type { CloudSyncError } from './errors';
|
|
2
|
+
import type { AutoFlushConfig } from './internal/autoFlush';
|
|
3
|
+
/**
|
|
4
|
+
* Full account state.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately not a boolean. `react-native-icloud-kit` exposes
|
|
7
|
+
* `isAvailable(): Bool`, which flattens CloudKit's five `CKAccountStatus`
|
|
8
|
+
* values into one bit - so an app cannot tell "signed out" (ask the user to
|
|
9
|
+
* sign in) from "temporarily unavailable" (retry silently) from "could not
|
|
10
|
+
* determine" (do nothing yet). Those three demand different product behaviour.
|
|
11
|
+
*/
|
|
12
|
+
export type AccountStatus = 'available' | 'noAccount' | 'restricted' | 'temporarilyUnavailable' | 'couldNotDetermine';
|
|
13
|
+
/** Why a remote-change event fired. Mirrors NSUbiquitousKeyValueStore's reasons. */
|
|
14
|
+
export type ChangeReason = 'serverChange' | 'initialSync' | 'quotaViolation' | 'accountChange' | 'unknown';
|
|
15
|
+
export interface RemoteChangeEvent {
|
|
16
|
+
/** Keys whose values changed. May be empty for `accountChange`/`quotaViolation`. */
|
|
17
|
+
keys: string[];
|
|
18
|
+
reason: ChangeReason;
|
|
19
|
+
provider: ProviderName;
|
|
20
|
+
}
|
|
21
|
+
export interface AccountChangeEvent {
|
|
22
|
+
status: AccountStatus;
|
|
23
|
+
/**
|
|
24
|
+
* True when the signed-in identity itself changed (a different Apple ID), as
|
|
25
|
+
* opposed to the same account merely becoming available or unavailable.
|
|
26
|
+
*
|
|
27
|
+
* This is the event nobody handles. MagisteriaApp stores an anonymous user id
|
|
28
|
+
* in iCloud and never observes `NSUbiquityIdentityDidChange`, so switching
|
|
29
|
+
* Apple ID silently keeps the previous user's identity - its own TODO records
|
|
30
|
+
* this as "sign out does not always give you a clean guest". Apps should treat
|
|
31
|
+
* `identityChanged: true` as "drop all cached user-scoped state".
|
|
32
|
+
*/
|
|
33
|
+
identityChanged: boolean;
|
|
34
|
+
provider: ProviderName;
|
|
35
|
+
}
|
|
36
|
+
export interface AssetProgressEvent {
|
|
37
|
+
recordName: string;
|
|
38
|
+
fieldName: string;
|
|
39
|
+
bytesTransferred: number;
|
|
40
|
+
bytesTotal: number;
|
|
41
|
+
}
|
|
42
|
+
/** The providers this package ships. */
|
|
43
|
+
export type { AutoFlushConfig };
|
|
44
|
+
export type BuiltInProviderName = 'icloudKV' | 'cloudKit' | 'cloudKitEncrypted' | 'googleDrive' | 'memory';
|
|
45
|
+
/**
|
|
46
|
+
* A provider's name.
|
|
47
|
+
*
|
|
48
|
+
* Open on purpose. `registerProvider` is documented as the way to plug in a
|
|
49
|
+
* provider you wrote yourself, but while this was a closed union of the four
|
|
50
|
+
* built-ins that was impossible to express in types - a `'dropbox'` provider
|
|
51
|
+
* needed a cast at every call site, including in `CloudStoreOptions.providers`.
|
|
52
|
+
* The `string & {}` arm keeps editor autocomplete for the built-in names while
|
|
53
|
+
* still accepting any other string.
|
|
54
|
+
*/
|
|
55
|
+
export type ProviderName = BuiltInProviderName | (string & {});
|
|
56
|
+
export type Unsubscribe = () => void;
|
|
57
|
+
/**
|
|
58
|
+
* The contract every provider implements. The facade in `store.ts` is written
|
|
59
|
+
* against this and nothing else, which is what makes providers swappable and
|
|
60
|
+
* makes the in-memory test double a first-class provider rather than a mock.
|
|
61
|
+
*/
|
|
62
|
+
export interface CloudProvider {
|
|
63
|
+
readonly name: ProviderName;
|
|
64
|
+
/**
|
|
65
|
+
* Whether this provider can currently be used. Cheap and non-throwing, so it
|
|
66
|
+
* is safe to call on a render path.
|
|
67
|
+
*/
|
|
68
|
+
isAvailable: () => Promise<boolean>;
|
|
69
|
+
getAccountStatus: () => Promise<AccountStatus>;
|
|
70
|
+
/**
|
|
71
|
+
* Resolves `null` if and only if the key does not exist. Every other failure
|
|
72
|
+
* rejects with a {@link CloudSyncError}. See `errors.ts` for why.
|
|
73
|
+
*/
|
|
74
|
+
getItem: (key: string) => Promise<string | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Like {@link getItem}, but also reports the server's own last-modified time.
|
|
77
|
+
*
|
|
78
|
+
* Optional because not every backing store knows one - `NSUbiquitousKeyValueStore`
|
|
79
|
+
* exposes no per-key timestamp at all. Where a provider *does* know (CloudKit's
|
|
80
|
+
* `modified.timestamp`, Drive's `modifiedTime`, both one query parameter away),
|
|
81
|
+
* implementing this lets {@link resolveByModifiedAt} order candidates without
|
|
82
|
+
* the app having to embed a timestamp inside its own payload.
|
|
83
|
+
*/
|
|
84
|
+
getItemWithMeta?: (key: string) => Promise<ItemWithMeta | null>;
|
|
85
|
+
setItem: (key: string, value: string) => Promise<void>;
|
|
86
|
+
removeItem: (key: string) => Promise<void>;
|
|
87
|
+
getAllKeys: () => Promise<string[]>;
|
|
88
|
+
/**
|
|
89
|
+
* Reads many keys in one go. Optional: the store falls back to sequential
|
|
90
|
+
* {@link getItem} calls when a provider does not implement it.
|
|
91
|
+
*
|
|
92
|
+
* Worth implementing whenever the backend has a batch endpoint - CloudKit Web
|
|
93
|
+
* Services' `/records/lookup` and `/records/modify` both take arrays, so the
|
|
94
|
+
* difference between this and a loop is one request against N.
|
|
95
|
+
*/
|
|
96
|
+
multiGet?: (keys: string[]) => Promise<(string | null)[]>;
|
|
97
|
+
/** Writes many key/value pairs in one go. Optional, same fallback rule. */
|
|
98
|
+
multiSet?: (entries: [string, string][]) => Promise<void>;
|
|
99
|
+
/** Removes many keys in one go. Optional, same fallback rule. */
|
|
100
|
+
multiRemove?: (keys: string[]) => Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Total and used bytes for this account, when the backend reports them.
|
|
103
|
+
* Optional - `NSUbiquitousKeyValueStore` has no usage API.
|
|
104
|
+
*/
|
|
105
|
+
getQuota?: () => Promise<QuotaInfo | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Drops any state cached for the *previous* account.
|
|
108
|
+
*
|
|
109
|
+
* Called by the store when an `identityChanged` account event arrives.
|
|
110
|
+
* Memoised Drive file ids and CloudKit reachability answers belong to whoever
|
|
111
|
+
* was signed in when they were recorded; serving them to the next user is a
|
|
112
|
+
* cross-account data leak.
|
|
113
|
+
*/
|
|
114
|
+
clearCaches?: () => void;
|
|
115
|
+
onRemoteChange?: (listener: (e: RemoteChangeEvent) => void) => Unsubscribe;
|
|
116
|
+
onAccountChange?: (listener: (e: AccountChangeEvent) => void) => Unsubscribe;
|
|
117
|
+
}
|
|
118
|
+
/** A value plus whatever metadata the provider could report alongside it. */
|
|
119
|
+
export interface ItemWithMeta {
|
|
120
|
+
value: string;
|
|
121
|
+
/** Server-reported last modification, epoch millis, when the provider knows one. */
|
|
122
|
+
modifiedAt?: number;
|
|
123
|
+
}
|
|
124
|
+
/** Account storage usage, for providers that report it. */
|
|
125
|
+
export interface QuotaInfo {
|
|
126
|
+
/** Bytes currently used, or undefined when the backend does not say. */
|
|
127
|
+
usedBytes?: number;
|
|
128
|
+
/** Total bytes available, or undefined for an unlimited/unreported quota. */
|
|
129
|
+
totalBytes?: number;
|
|
130
|
+
provider: ProviderName;
|
|
131
|
+
}
|
|
132
|
+
/** Byte thresholds that decide which backing store a value lands in. */
|
|
133
|
+
export interface TieringConfig {
|
|
134
|
+
/**
|
|
135
|
+
* At or below this, values go to the iCloud key-value store.
|
|
136
|
+
*
|
|
137
|
+
* Apple's hard limits are 1 MB total / 1 MB per key / 1024 keys, but the
|
|
138
|
+
* *total* is the one that bites - a handful of large values silently starves
|
|
139
|
+
* every other key. 64 KB keeps the KV store for what it is good at (settings,
|
|
140
|
+
* small identifiers) and pushes real payloads to CloudKit records.
|
|
141
|
+
*/
|
|
142
|
+
kvMaxBytes: number;
|
|
143
|
+
/**
|
|
144
|
+
* At or below this, values go in a CKRecord field. CloudKit's documented
|
|
145
|
+
* record ceiling is 1 MB excluding assets; 900 KB leaves room for the record's
|
|
146
|
+
* own metadata.
|
|
147
|
+
*/
|
|
148
|
+
recordMaxBytes: number;
|
|
149
|
+
}
|
|
150
|
+
export declare const DEFAULT_TIERING: TieringConfig;
|
|
151
|
+
export interface OutboxEntry {
|
|
152
|
+
key: string;
|
|
153
|
+
value: string | null;
|
|
154
|
+
provider: ProviderName;
|
|
155
|
+
attempts: number;
|
|
156
|
+
/** Epoch millis of the next attempt. */
|
|
157
|
+
nextAttemptAt: number;
|
|
158
|
+
enqueuedAt: number;
|
|
159
|
+
/**
|
|
160
|
+
* The error code of the most recent failed attempt, so a "pending sync" UI
|
|
161
|
+
* can say *why* something is still queued rather than only that it is.
|
|
162
|
+
*/
|
|
163
|
+
lastErrorCode?: string;
|
|
164
|
+
}
|
|
165
|
+
/** Why the store gave up on a queued write. Reported through {@link CloudStoreOptions.onDropped}. */
|
|
166
|
+
/**
|
|
167
|
+
* - `notRetryable` - the failure stopped being retryable; the user has to act on it.
|
|
168
|
+
* - `tooManyAttempts` - {@link CloudStoreOptions.outboxMaxAttempts} was reached.
|
|
169
|
+
* - `expired` - it sat in the queue longer than {@link CloudStoreOptions.outboxMaxAgeMs}.
|
|
170
|
+
* - `queueFull` - the queue hit its cap and this was the oldest entry.
|
|
171
|
+
* - `accountChanged` - a different account signed in, so it belongs to nobody now.
|
|
172
|
+
* - `discarded` - `discardPendingWrites` removed it.
|
|
173
|
+
*/
|
|
174
|
+
export type DropReason = 'notRetryable' | 'tooManyAttempts' | 'expired' | 'queueFull' | 'accountChanged' | 'discarded';
|
|
175
|
+
export interface DroppedWrite {
|
|
176
|
+
entry: OutboxEntry;
|
|
177
|
+
reason: DropReason;
|
|
178
|
+
/** The failure that caused it, when there was one. */
|
|
179
|
+
error?: CloudSyncError;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* How a write is distributed across the configured providers.
|
|
183
|
+
*
|
|
184
|
+
* - `failover` - write to the first available provider only. The rest are read
|
|
185
|
+
* fallbacks. Cheapest, and right when the providers are alternatives.
|
|
186
|
+
* - `mirror` - write to every available provider. Costs one request per
|
|
187
|
+
* provider, and is what makes a value written on an iPhone readable on
|
|
188
|
+
* Android: the Apple-only providers cannot be reached from there, so unless
|
|
189
|
+
* something also wrote to Drive, there is nothing for Android to find.
|
|
190
|
+
*
|
|
191
|
+
* Reads fall through the list in both modes.
|
|
192
|
+
*/
|
|
193
|
+
export type WriteMode = 'failover' | 'mirror';
|
|
194
|
+
/** One provider's copy of a key, as seen during a resolving read. */
|
|
195
|
+
export interface ResolveCandidate {
|
|
196
|
+
provider: ProviderName;
|
|
197
|
+
value: string;
|
|
198
|
+
/**
|
|
199
|
+
* The server's own last-modified time in epoch millis, when the provider
|
|
200
|
+
* reported one (see {@link CloudProvider.getItemWithMeta}).
|
|
201
|
+
*
|
|
202
|
+
* This is what {@link resolveByModifiedAt} orders on, and it is why that
|
|
203
|
+
* resolver works on payloads the app never had to instrument.
|
|
204
|
+
*/
|
|
205
|
+
modifiedAt?: number;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Picks the winner when providers disagree.
|
|
209
|
+
*
|
|
210
|
+
* The store holds opaque strings, so it cannot know which copy is newer - only
|
|
211
|
+
* the app knows what its values mean. Returning `null` means "none of these",
|
|
212
|
+
* which reads as absent.
|
|
213
|
+
*/
|
|
214
|
+
export type ResolveFn = (candidates: ResolveCandidate[]) => string | null;
|
|
215
|
+
export interface CloudStoreOptions {
|
|
216
|
+
/**
|
|
217
|
+
* Providers in preference order.
|
|
218
|
+
*
|
|
219
|
+
* Reads fall through this list until a value is found. Writes go to the first
|
|
220
|
+
* available provider, or to all of them - see {@link writeMode}.
|
|
221
|
+
*/
|
|
222
|
+
providers: ProviderName[];
|
|
223
|
+
/**
|
|
224
|
+
* Default `failover`.
|
|
225
|
+
*
|
|
226
|
+
* Use `mirror` when the same data has to be reachable from a platform where
|
|
227
|
+
* the preferred provider does not exist.
|
|
228
|
+
*/
|
|
229
|
+
writeMode?: WriteMode;
|
|
230
|
+
/**
|
|
231
|
+
* How a read picks a value when more than one provider holds the key.
|
|
232
|
+
*
|
|
233
|
+
* Without this, `getItem` returns the first non-null value in provider order
|
|
234
|
+
* and stops. That is cheap and correct when only one device population
|
|
235
|
+
* writes - but it silently serves stale data as soon as writes come from
|
|
236
|
+
* both sides. An Apple device reading `['icloudKV', 'googleDrive']` always
|
|
237
|
+
* finds *something* in iCloud, so a newer value written from Android via
|
|
238
|
+
* Drive is never even looked at.
|
|
239
|
+
*
|
|
240
|
+
* Supplying this makes a read consult every available provider and hand you
|
|
241
|
+
* the candidates. {@link resolveByTimestamp} covers the usual case.
|
|
242
|
+
*/
|
|
243
|
+
resolve?: ResolveFn;
|
|
244
|
+
/**
|
|
245
|
+
* After a resolving read, write the winner back to providers that disagreed.
|
|
246
|
+
*
|
|
247
|
+
* Default true when {@link resolve} is set. This is what actually makes two
|
|
248
|
+
* populations converge: without it, the losing store keeps its old value and
|
|
249
|
+
* every read pays to resolve again forever.
|
|
250
|
+
*
|
|
251
|
+
* Best-effort - a failed repair never fails the read.
|
|
252
|
+
*/
|
|
253
|
+
repairOnRead?: boolean;
|
|
254
|
+
tiering?: TieringConfig | 'auto' | 'off';
|
|
255
|
+
/**
|
|
256
|
+
* Persist failed writes and retry them with backoff.
|
|
257
|
+
*
|
|
258
|
+
* Default true. With it off, a write made while offline is lost - which is
|
|
259
|
+
* exactly the documented behaviour of react-native-cloud-storage today
|
|
260
|
+
* ("the OS will not throw an error ... you'll need to check for an internet
|
|
261
|
+
* connection before handing data to" it).
|
|
262
|
+
*/
|
|
263
|
+
outbox?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Hard cap on queued writes. Default 1000.
|
|
266
|
+
*
|
|
267
|
+
* An unbounded queue is a slow memory and storage leak: every `enqueue`
|
|
268
|
+
* rewrites the whole JSON blob, so an app that stays offline long enough
|
|
269
|
+
* degrades its own write path. When the cap is hit the oldest entry is
|
|
270
|
+
* dropped and reported through {@link onDropped}, so the loss is visible
|
|
271
|
+
* rather than silent.
|
|
272
|
+
*/
|
|
273
|
+
outboxMaxEntries?: number;
|
|
274
|
+
/**
|
|
275
|
+
* Give up on a queued write after this many failed attempts. Default 12,
|
|
276
|
+
* which with the capped exponential backoff is roughly an hour of retrying.
|
|
277
|
+
*/
|
|
278
|
+
outboxMaxAttempts?: number;
|
|
279
|
+
/**
|
|
280
|
+
* Give up on a queued write older than this. Default 7 days.
|
|
281
|
+
*
|
|
282
|
+
* Time matters independently of attempt count: an app opened twice in a month
|
|
283
|
+
* accrues almost no attempts, and re-sending a fortnight-old value over
|
|
284
|
+
* whatever the user has done since is rarely what they want.
|
|
285
|
+
*/
|
|
286
|
+
outboxMaxAgeMs?: number;
|
|
287
|
+
/** Called whenever a queued write is abandoned, with the reason. */
|
|
288
|
+
onDropped?: (dropped: DroppedWrite) => void;
|
|
289
|
+
/**
|
|
290
|
+
* Drain the outbox automatically, instead of leaving `flushOutbox()` entirely
|
|
291
|
+
* to the caller. Off by default; pass `true` for the defaults.
|
|
292
|
+
*
|
|
293
|
+
* A durable queue with no trigger is only half a feature - every retryable
|
|
294
|
+
* failure is captured correctly and then waits for someone to remember. This
|
|
295
|
+
* flushes on app foreground and on a slow timer, which is where nearly every
|
|
296
|
+
* app was calling it by hand.
|
|
297
|
+
*
|
|
298
|
+
* Not network-aware, on purpose: that needs NetInfo, and adding a dependency
|
|
299
|
+
* every consumer must install to save one line in the ones that want it is a
|
|
300
|
+
* bad trade. Call `flushOutbox()` from your own reconnect listener too if you
|
|
301
|
+
* have one.
|
|
302
|
+
*/
|
|
303
|
+
autoFlush?: boolean | AutoFlushConfig;
|
|
304
|
+
/**
|
|
305
|
+
* How long an `isAvailable()` answer is reused across operations. Default 3000.
|
|
306
|
+
*
|
|
307
|
+
* The store asks every provider before every operation, and for `icloudKV`
|
|
308
|
+
* that is a bridge hop while for `googleDrive` it invokes the host's
|
|
309
|
+
* `getAccessToken`. Unmemoised, a loop over 100 keys cost 100+ probes on top
|
|
310
|
+
* of the actual work. Set to 0 to probe every time.
|
|
311
|
+
*/
|
|
312
|
+
availabilityTtlMs?: number;
|
|
313
|
+
/**
|
|
314
|
+
* Transforms values on the way out and back on the way in - the seam for
|
|
315
|
+
* encrypting at rest.
|
|
316
|
+
*
|
|
317
|
+
* Drive's `appDataFolder` is plaintext to anything holding the account's OAuth
|
|
318
|
+
* token, and this package deliberately ships no crypto of its own (key
|
|
319
|
+
* management is the app's problem, and bundling a cipher would make it look
|
|
320
|
+
* solved). Supplying a codec is how you close that gap with a library you
|
|
321
|
+
* chose.
|
|
322
|
+
*
|
|
323
|
+
* Applied to values only, never to keys - `getAllKeys()`, tiering and read
|
|
324
|
+
* repair all need cleartext keys to work.
|
|
325
|
+
*
|
|
326
|
+
* Encoding runs *before* tiering picks a destination, so a value is routed by
|
|
327
|
+
* the size it will actually occupy rather than by its plaintext size. That is
|
|
328
|
+
* the correct behaviour, and it means a codec that inflates its input makes
|
|
329
|
+
* your effective {@link TieringConfig.kvMaxBytes} smaller than the number
|
|
330
|
+
* says.
|
|
331
|
+
*/
|
|
332
|
+
codec?: ValueCodec;
|
|
333
|
+
/**
|
|
334
|
+
* Reject keys that cannot round-trip through every configured provider.
|
|
335
|
+
* Default true.
|
|
336
|
+
*
|
|
337
|
+
* One key string has to be a `NSUbiquitousKeyValueStore` key, a CloudKit
|
|
338
|
+
* `recordName` and a Drive filename at once, and those three disagree about
|
|
339
|
+
* what is legal. Without this check an invalid `recordName` comes back from
|
|
340
|
+
* CloudKit as `BAD_REQUEST`, which maps to `ERR_CONTAINER_MISCONFIGURED` and
|
|
341
|
+
* sends you looking at your entitlements instead of at your key.
|
|
342
|
+
*/
|
|
343
|
+
validateKeys?: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Abandon a single provider operation that has not settled in this long,
|
|
346
|
+
* with {@link ErrorCode.TIMEOUT}. Off by default.
|
|
347
|
+
*
|
|
348
|
+
* React Native's `fetch` has no default timeout and neither does CloudKit's
|
|
349
|
+
* native stack, so a socket that never answers hangs the operation forever -
|
|
350
|
+
* including `isAvailable()`, which the store calls before everything else.
|
|
351
|
+
* A timeout is classified as retryable, so with the outbox on, a hung write
|
|
352
|
+
* is queued rather than lost.
|
|
353
|
+
*/
|
|
354
|
+
timeoutMs?: number;
|
|
355
|
+
onError?: (e: CloudSyncError) => void;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* A two-way value transform, applied at the boundary between the store and its
|
|
359
|
+
* providers. See {@link CloudStoreOptions.codec}.
|
|
360
|
+
*/
|
|
361
|
+
export interface ValueCodec {
|
|
362
|
+
/** Called with the app's value; the result is what the provider stores. */
|
|
363
|
+
encode: (value: string, key: string) => Promise<string> | string;
|
|
364
|
+
/** Called with what the provider returned; the result is what the app sees. */
|
|
365
|
+
decode: (value: string, key: string) => Promise<string> | string;
|
|
366
|
+
}
|
|
367
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GACnB,WAAW,GACX,WAAW,GACX,YAAY,GACZ,wBAAwB,GACxB,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