sliftutils 1.7.9 → 1.7.11
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/bin/storageserver.js +4 -0
- package/{teststorage → examplestorage}/browser.tsx +18 -22
- package/{teststorage/server.ts → examplestorage/exampleserver.ts} +4 -6
- package/index.d.ts +770 -84
- package/misc/dist/environment.ts.cache +3 -3
- package/misc/dist/getSecret.ts.cache +139 -0
- package/misc/dist/strings.ts.cache +13 -0
- package/misc/dist/zip.ts.cache +9 -0
- package/misc/getSecret.ts +38 -16
- package/misc/https/cloudflareHelpers.d.ts +19 -0
- package/misc/https/cloudflareHelpers.ts +69 -0
- package/misc/https/dist/certs.ts.cache +115 -179
- package/misc/https/dist/cloudflareHelpers.ts.cache +68 -0
- package/misc/https/dist/dns.ts.cache +112 -100
- package/misc/https/dist/hostServer.ts.cache +130 -0
- package/misc/https/dist/httpsCerts.ts.cache +24 -5
- package/misc/https/dist/persistentLocalStorage.ts.cache +3 -2
- package/misc/https/dns.d.ts +41 -8
- package/misc/https/dns.ts +104 -106
- package/misc/https/hostServer.d.ts +0 -3
- package/misc/https/hostServer.ts +12 -8
- package/package.json +3 -2
- package/render-utils/dist/observer.tsx.cache +3 -2
- package/spec.txt +0 -55
- package/storage/ArchivesDisk.d.ts +67 -0
- package/storage/ArchivesDisk.ts +369 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseBase.ts.cache +1242 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseFormat.ts.cache +513 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseMerge.ts.cache +352 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseReader.ts.cache +306 -0
- package/storage/BulkDatabase2/dist/LoadedIndex.ts.cache +435 -0
- package/storage/BulkDatabase2/dist/WriteOverlay.ts.cache +58 -0
- package/storage/BulkDatabase2/dist/blockCache.ts.cache +179 -0
- package/storage/BulkDatabase2/dist/mergeLock.ts.cache +149 -0
- package/storage/BulkDatabase2/dist/mergeMarkers.ts.cache +101 -0
- package/storage/BulkDatabase2/dist/streamLog.ts.cache +227 -0
- package/storage/BulkDatabase2/dist/syncClient.ts.cache +104 -0
- package/storage/IArchives.d.ts +127 -1
- package/storage/IArchives.ts +201 -1
- package/storage/backblaze.d.ts +29 -2
- package/storage/backblaze.ts +214 -78
- package/storage/dist/ArchivesDisk.ts.cache +373 -0
- package/storage/dist/FileFolderAPI.tsx.cache +508 -65
- package/storage/dist/IArchives.ts.cache +44 -0
- package/storage/dist/IndexedDBFileFolderAPI.ts.cache +8 -2
- package/storage/dist/JSONStorage.ts.cache +6 -2
- package/storage/dist/PendingManager.tsx.cache +1 -1
- package/storage/dist/TransactionStorage.ts.cache +231 -92
- package/storage/dist/backblaze.ts.cache +797 -0
- package/storage/dist/fileSystemPointer.ts.cache +36 -3
- package/storage/dist/remoteFileStorage.ts.cache +495 -0
- package/storage/remoteStorage/ArchivesRemote.d.ts +34 -18
- package/storage/remoteStorage/ArchivesRemote.ts +85 -65
- package/storage/remoteStorage/ArchivesUrl.d.ts +48 -0
- package/storage/remoteStorage/ArchivesUrl.ts +86 -0
- package/storage/remoteStorage/accessPage.tsx +111 -28
- package/storage/remoteStorage/blobStore.d.ts +128 -25
- package/storage/remoteStorage/blobStore.ts +757 -290
- package/storage/remoteStorage/cliArgs.d.ts +1 -0
- package/storage/remoteStorage/cliArgs.ts +9 -0
- package/storage/remoteStorage/createArchives.d.ts +85 -0
- package/storage/remoteStorage/createArchives.ts +612 -0
- package/storage/remoteStorage/dist/ArchivesRemote.ts.cache +197 -0
- package/storage/remoteStorage/dist/ArchivesUrl.ts.cache +85 -0
- package/storage/remoteStorage/dist/accessPage.tsx.cache +222 -0
- package/storage/remoteStorage/dist/blobStore.ts.cache +837 -0
- package/storage/remoteStorage/dist/cliArgs.ts.cache +16 -0
- package/storage/remoteStorage/dist/createArchives.ts.cache +610 -0
- package/storage/remoteStorage/dist/remoteConfig.ts.cache +206 -0
- package/storage/remoteStorage/dist/sourceWrapper.ts.cache +223 -0
- package/storage/remoteStorage/dist/storageController.ts.cache +500 -0
- package/storage/remoteStorage/dist/storageServer.ts.cache +106 -0
- package/storage/remoteStorage/dist/storageServerCli.ts.cache +39 -0
- package/storage/remoteStorage/dist/storageServerState.ts.cache +518 -0
- package/storage/remoteStorage/grantAccess.js +4 -0
- package/storage/remoteStorage/grantAccessCli.d.ts +1 -0
- package/storage/remoteStorage/grantAccessCli.ts +27 -0
- package/storage/remoteStorage/remoteConfig.d.ts +29 -0
- package/storage/remoteStorage/remoteConfig.ts +194 -0
- package/storage/remoteStorage/sourceWrapper.d.ts +41 -0
- package/storage/remoteStorage/sourceWrapper.ts +223 -0
- package/storage/remoteStorage/spec.md +31 -0
- package/storage/remoteStorage/storageController.d.ts +30 -27
- package/storage/remoteStorage/storageController.ts +297 -159
- package/storage/remoteStorage/storageServer.d.ts +6 -0
- package/storage/remoteStorage/storageServer.ts +88 -94
- package/storage/remoteStorage/storageServerCli.d.ts +1 -0
- package/storage/remoteStorage/storageServerCli.ts +38 -0
- package/storage/remoteStorage/storageServerState.d.ts +43 -0
- package/storage/remoteStorage/storageServerState.ts +540 -0
- package/testsite/server.ts +0 -2
- package/yarn.lock +11 -6
|
@@ -1,44 +1,142 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import { ArchiveFileInfo } from "../IArchives";
|
|
3
|
+
import { ArchiveFileInfo, ArchivesSource, ArchivesSyncStatus, SyncActivity } from "../IArchives";
|
|
4
4
|
export declare const DEFAULT_FAST_WRITE_DELAY: number;
|
|
5
5
|
export type WriteConfig = {
|
|
6
6
|
fast?: boolean;
|
|
7
7
|
writeDelay?: number;
|
|
8
|
+
lastModified?: number;
|
|
8
9
|
};
|
|
9
|
-
export
|
|
10
|
+
export type IBucketStore = {
|
|
11
|
+
get(fileName: string, config?: {
|
|
12
|
+
range?: {
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
};
|
|
16
|
+
}): Promise<Buffer | undefined>;
|
|
17
|
+
get2(fileName: string, config?: {
|
|
18
|
+
range?: {
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
};
|
|
22
|
+
}): Promise<{
|
|
23
|
+
data: Buffer;
|
|
24
|
+
writeTime: number;
|
|
25
|
+
size: number;
|
|
26
|
+
} | undefined>;
|
|
27
|
+
set(fileName: string, data: Buffer, config?: WriteConfig): Promise<void>;
|
|
28
|
+
del(fileName: string, config?: WriteConfig): Promise<void>;
|
|
29
|
+
getInfo(fileName: string): Promise<{
|
|
30
|
+
writeTime: number;
|
|
31
|
+
size: number;
|
|
32
|
+
} | undefined>;
|
|
33
|
+
findInfo(prefix: string, config?: {
|
|
34
|
+
shallow?: boolean;
|
|
35
|
+
type?: "files" | "folders";
|
|
36
|
+
}): Promise<ArchiveFileInfo[]>;
|
|
37
|
+
getChangesAfter?(time: number): Promise<ArchiveFileInfo[]>;
|
|
38
|
+
getSyncStatus?(): Promise<ArchivesSyncStatus>;
|
|
39
|
+
getSyncProgress?(): {
|
|
40
|
+
index: {
|
|
41
|
+
fileCount: number;
|
|
42
|
+
byteCount: number;
|
|
43
|
+
};
|
|
44
|
+
syncing: SyncActivity[];
|
|
45
|
+
};
|
|
46
|
+
computeIndexTotals?(): Promise<{
|
|
47
|
+
fileCount: number;
|
|
48
|
+
byteCount: number;
|
|
49
|
+
}>;
|
|
50
|
+
startLargeUpload(): Promise<string>;
|
|
51
|
+
appendLargeUpload(id: string, data: Buffer): Promise<void>;
|
|
52
|
+
finishLargeUpload(id: string, key: string): Promise<void>;
|
|
53
|
+
cancelLargeUpload(id: string): Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
export declare class BlobStore implements IBucketStore {
|
|
10
56
|
private folder;
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
private
|
|
18
|
-
private currentBlobNumber;
|
|
19
|
-
private currentBlobOffset;
|
|
20
|
-
private currentBlobFd;
|
|
57
|
+
private sources;
|
|
58
|
+
private config?;
|
|
59
|
+
constructor(folder: string, sources: ArchivesSource[], config?: {
|
|
60
|
+
onIndexChanged?: ((key: string) => void) | undefined;
|
|
61
|
+
readerDiskLimit?: number | undefined;
|
|
62
|
+
} | undefined);
|
|
63
|
+
private stopped;
|
|
21
64
|
private index;
|
|
22
|
-
private
|
|
23
|
-
private
|
|
65
|
+
private mem;
|
|
66
|
+
private indexFileCount;
|
|
67
|
+
private indexByteCount;
|
|
68
|
+
private sourceFileCounts;
|
|
69
|
+
private sourceByteCounts;
|
|
70
|
+
private syncActivities;
|
|
71
|
+
private dirty;
|
|
72
|
+
private overlay;
|
|
73
|
+
private sourceStates;
|
|
24
74
|
init: {
|
|
25
75
|
(): Promise<void>;
|
|
26
76
|
reset(): void;
|
|
27
77
|
set(newValue: Promise<void>): void;
|
|
28
78
|
};
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private closeBlobHandle;
|
|
33
|
-
private addDeadBytes;
|
|
34
|
-
private appendData;
|
|
79
|
+
dispose(): Promise<void>;
|
|
80
|
+
private loadIndex;
|
|
81
|
+
private countEntry;
|
|
35
82
|
private setIndexEntry;
|
|
83
|
+
private deleteIndexEntry;
|
|
84
|
+
/** The cheap always-current totals plus any in-progress background synchronization. */
|
|
85
|
+
getSyncProgress(): {
|
|
86
|
+
index: {
|
|
87
|
+
fileCount: number;
|
|
88
|
+
byteCount: number;
|
|
89
|
+
};
|
|
90
|
+
sources: {
|
|
91
|
+
debugName: string;
|
|
92
|
+
fileCount: number;
|
|
93
|
+
byteCount: number;
|
|
94
|
+
}[];
|
|
95
|
+
readerDiskLimit?: number;
|
|
96
|
+
syncing: SyncActivity[];
|
|
97
|
+
};
|
|
98
|
+
/** Walks the whole index for exact totals - more expensive than getSyncProgress, but immune to
|
|
99
|
+
* any drift in the maintained counters (and loads the index first, so it's never cold zeros). */
|
|
100
|
+
computeIndexTotals(): Promise<{
|
|
101
|
+
fileCount: number;
|
|
102
|
+
byteCount: number;
|
|
103
|
+
sources: {
|
|
104
|
+
debugName: string;
|
|
105
|
+
fileCount: number;
|
|
106
|
+
byteCount: number;
|
|
107
|
+
}[];
|
|
108
|
+
}>;
|
|
109
|
+
private flushIndex;
|
|
110
|
+
private runSourceSync;
|
|
111
|
+
private scanSource;
|
|
112
|
+
private reconcileSource;
|
|
113
|
+
private applyScanned;
|
|
114
|
+
private pollChanges;
|
|
115
|
+
private copySourceFiles;
|
|
116
|
+
private waitForRequiredScans;
|
|
117
|
+
private checkMissingKey;
|
|
118
|
+
private getIndexEntry;
|
|
119
|
+
get(key: string, config?: {
|
|
120
|
+
range?: {
|
|
121
|
+
start: number;
|
|
122
|
+
end: number;
|
|
123
|
+
};
|
|
124
|
+
}): Promise<Buffer | undefined>;
|
|
125
|
+
get2(key: string, config?: {
|
|
126
|
+
range?: {
|
|
127
|
+
start: number;
|
|
128
|
+
end: number;
|
|
129
|
+
};
|
|
130
|
+
}): Promise<{
|
|
131
|
+
data: Buffer;
|
|
132
|
+
writeTime: number;
|
|
133
|
+
size: number;
|
|
134
|
+
} | undefined>;
|
|
135
|
+
private cacheRead;
|
|
36
136
|
set(key: string, data: Buffer, config?: WriteConfig): Promise<void>;
|
|
37
137
|
del(key: string, config?: WriteConfig): Promise<void>;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
end: number;
|
|
41
|
-
}): Promise<Buffer | undefined>;
|
|
138
|
+
private getWritableSources;
|
|
139
|
+
private writeToSources;
|
|
42
140
|
getInfo(key: string): Promise<{
|
|
43
141
|
writeTime: number;
|
|
44
142
|
size: number;
|
|
@@ -47,10 +145,15 @@ export declare class BlobStore {
|
|
|
47
145
|
shallow?: boolean;
|
|
48
146
|
type?: "files" | "folders";
|
|
49
147
|
}): Promise<ArchiveFileInfo[]>;
|
|
148
|
+
getChangesAfter(time: number): Promise<ArchiveFileInfo[]>;
|
|
149
|
+
getSyncStatus(): Promise<ArchivesSyncStatus>;
|
|
150
|
+
private getDiskSource;
|
|
50
151
|
startLargeUpload(): Promise<string>;
|
|
51
152
|
appendLargeUpload(id: string, data: Buffer): Promise<void>;
|
|
52
153
|
finishLargeUpload(id: string, key: string): Promise<void>;
|
|
53
154
|
cancelLargeUpload(id: string): Promise<void>;
|
|
54
155
|
private flushOverlay;
|
|
55
|
-
private
|
|
156
|
+
private evicting;
|
|
157
|
+
private enforceDiskLimit;
|
|
158
|
+
private cleanupTombstones;
|
|
56
159
|
}
|