sliftutils 1.7.71 → 1.7.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/index.d.ts +506 -257
  2. package/misc/https/dist/hostServer.ts.cache +5 -2
  3. package/package.json +1 -1
  4. package/spec.txt +10 -0
  5. package/storage/ArchivesDisk.d.ts +4 -13
  6. package/storage/ArchivesDisk.ts +6 -4
  7. package/storage/IArchives.d.ts +15 -10
  8. package/storage/IArchives.ts +19 -6
  9. package/storage/backblaze.d.ts +3 -9
  10. package/storage/backblaze.ts +22 -19
  11. package/storage/dist/ArchivesDisk.ts.cache +5 -2
  12. package/storage/dist/IArchives.ts.cache +17 -3
  13. package/storage/dist/backblaze.ts.cache +35 -26
  14. package/storage/remoteStorage/ArchivesRemote.d.ts +5 -9
  15. package/storage/remoteStorage/ArchivesRemote.ts +25 -20
  16. package/storage/remoteStorage/ArchivesUrl.d.ts +3 -9
  17. package/storage/remoteStorage/ArchivesUrl.ts +7 -5
  18. package/storage/remoteStorage/accessPage.tsx +4 -4
  19. package/storage/remoteStorage/accessStats.d.ts +2 -0
  20. package/storage/remoteStorage/accessStats.ts +32 -0
  21. package/storage/remoteStorage/blobStore.d.ts +193 -88
  22. package/storage/remoteStorage/blobStore.ts +535 -400
  23. package/storage/remoteStorage/bucketDisk.d.ts +18 -0
  24. package/storage/remoteStorage/bucketDisk.ts +66 -0
  25. package/storage/remoteStorage/createArchives.d.ts +4 -10
  26. package/storage/remoteStorage/createArchives.ts +103 -62
  27. package/storage/remoteStorage/dist/ArchivesRemote.ts.cache +28 -19
  28. package/storage/remoteStorage/dist/ArchivesUrl.ts.cache +7 -4
  29. package/storage/remoteStorage/dist/accessPage.tsx.cache +6 -6
  30. package/storage/remoteStorage/dist/accessStats.ts.cache +38 -3
  31. package/storage/remoteStorage/dist/blobStore.ts.cache +516 -374
  32. package/storage/remoteStorage/dist/bucketDisk.ts.cache +72 -0
  33. package/storage/remoteStorage/dist/createArchives.ts.cache +114 -57
  34. package/storage/remoteStorage/dist/intermediateSources.ts.cache +12 -12
  35. package/storage/remoteStorage/dist/remoteConfig.ts.cache +18 -2
  36. package/storage/remoteStorage/dist/serverConfig.ts.cache +116 -0
  37. package/storage/remoteStorage/dist/sourceWrapper.ts.cache +6 -5
  38. package/storage/remoteStorage/dist/sourcesList.ts.cache +5 -2
  39. package/storage/remoteStorage/dist/storageController.ts.cache +223 -190
  40. package/storage/remoteStorage/dist/storageServer.ts.cache +9 -9
  41. package/storage/remoteStorage/dist/storageServerState.ts.cache +329 -566
  42. package/storage/remoteStorage/dist/storePlan.ts.cache +149 -0
  43. package/storage/remoteStorage/dist/validation.ts.cache +40 -0
  44. package/storage/remoteStorage/grantAccessCli.ts +1 -1
  45. package/storage/remoteStorage/intermediateSources.d.ts +3 -5
  46. package/storage/remoteStorage/intermediateSources.ts +14 -16
  47. package/storage/remoteStorage/remoteConfig.d.ts +2 -2
  48. package/storage/remoteStorage/remoteConfig.ts +19 -3
  49. package/storage/remoteStorage/serverConfig.d.ts +27 -0
  50. package/storage/remoteStorage/serverConfig.ts +109 -0
  51. package/storage/remoteStorage/sourceWrapper.d.ts +3 -3
  52. package/storage/remoteStorage/sourceWrapper.ts +7 -6
  53. package/storage/remoteStorage/sourcesList.ts +3 -0
  54. package/storage/remoteStorage/storageController.d.ts +118 -36
  55. package/storage/remoteStorage/storageController.ts +166 -168
  56. package/storage/remoteStorage/storageServer.ts +1 -1
  57. package/storage/remoteStorage/storageServerState.d.ts +52 -63
  58. package/storage/remoteStorage/storageServerState.ts +340 -584
  59. package/storage/remoteStorage/storePlan.d.ts +34 -0
  60. package/storage/remoteStorage/storePlan.ts +166 -0
  61. package/storage/remoteStorage/validation.d.ts +4 -0
  62. package/storage/remoteStorage/validation.ts +31 -0
@@ -1,4 +1,5 @@
1
1
  import fs from "fs";
2
+ import path from "path";
2
3
 
3
4
  const RELOAD_THROTTLE = 5 * 1000;
4
5
 
@@ -54,6 +55,8 @@ export class SourcesList {
54
55
  await this.load();
55
56
  let existing = this.indexes.get(url);
56
57
  if (existing !== undefined) return existing;
58
+ // appendFile creates the file but not its parent directories, and on a fresh bucket we run before anything else has created them
59
+ await fs.promises.mkdir(path.dirname(this.filePath), { recursive: true });
57
60
  let prefix = this.endsClean && "" || "\n";
58
61
  await fs.promises.appendFile(this.filePath, prefix + url + "\n");
59
62
  this.endsClean = true;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import { ArchiveFileInfo, ArchivesConfig, ArchivesSyncStatus, ChangesAfterConfig } from "../IArchives";
4
- import { ServerBucketInfo, ActiveBucketInfo } from "./storageServerState";
3
+ import { ArchiveFileInfo, ArchivesConfig, ArchivesSyncStatus, FindConfig, SourceConfig } from "../IArchives";
4
+ import { ActiveBucketInfo, ServerBucketInfo } from "./storageServerState";
5
5
  import { AccessTotals, AccessSummaryState } from "./accessStats";
6
6
  import type { SummaryEntry } from "../../treeSummary";
7
7
  export declare const REMOTE_STORAGE_CLASS_GUID = "RemoteStorageController-b7e42a91";
@@ -45,58 +45,124 @@ export declare const RemoteStorageController: import("socket-function/SocketFunc
45
45
  machineId: string;
46
46
  ip: string;
47
47
  }>;
48
- requestAccess: (account: string) => Promise<{
48
+ requestAccess: (config: {
49
+ account: string;
50
+ }) => Promise<{
49
51
  machineId: string;
50
52
  ip: string;
51
53
  requestId: string;
52
54
  grantAccessCommand: string;
53
55
  }>;
54
- getAccessState: (account: string) => Promise<AccessState>;
55
- listRequestsForIP: (account: string, ip: string) => Promise<AccessRequest[]>;
56
- grantAccess: (requestId: string) => Promise<TrustRecord>;
56
+ getAccessState: (config: {
57
+ account: string;
58
+ }) => Promise<AccessState>;
59
+ listRequestsForIP: (config: {
60
+ account: string;
61
+ ip: string;
62
+ }) => Promise<AccessRequest[]>;
63
+ grantAccess: (config: {
64
+ requestId: string;
65
+ }) => Promise<TrustRecord>;
57
66
  adminListActiveBuckets: () => Promise<{
58
67
  account: string;
59
68
  bucketName: string;
60
69
  }[]>;
61
- adminListRequests: (ip: string) => Promise<AccessRequest[]>;
62
- adminGrantAccess: (requestId: string) => Promise<TrustRecord>;
63
- get: (account: string, bucketName: string, path: string, range?: {
64
- start: number;
65
- end: number;
66
- }) => Promise<Buffer | undefined>;
67
- get2: (account: string, bucketName: string, path: string, range?: {
68
- start: number;
69
- end: number;
70
- }, internal?: boolean) => Promise<{
70
+ adminListRequests: (config: {
71
+ ip: string;
72
+ }) => Promise<AccessRequest[]>;
73
+ adminGrantAccess: (config: {
74
+ requestId: string;
75
+ }) => Promise<TrustRecord>;
76
+ get2: (config: {
77
+ account: string;
78
+ bucketName: string;
79
+ path: string;
80
+ sourceConfig: SourceConfig;
81
+ range?: {
82
+ start: number;
83
+ end: number;
84
+ };
85
+ internal?: boolean;
86
+ includeTombstones?: boolean;
87
+ }) => Promise<{
71
88
  data: Buffer;
72
89
  writeTime: number;
73
90
  size: number;
74
91
  } | undefined>;
75
- set: (account: string, bucketName: string, path: string, data: Buffer, lastModified?: number, forceSetImmutable?: boolean, internal?: boolean) => Promise<void>;
76
- del: (account: string, bucketName: string, path: string, lastModified?: number, internal?: boolean) => Promise<void>;
77
- getInfo: (account: string, bucketName: string, path: string, includeTombstones?: boolean) => Promise<{
92
+ set: (config: {
93
+ account: string;
94
+ bucketName: string;
95
+ path: string;
96
+ data: Buffer;
97
+ sourceConfig: SourceConfig;
98
+ lastModified?: number;
99
+ forceSetImmutable?: boolean;
100
+ internal?: boolean;
101
+ }) => Promise<void>;
102
+ del: (config: {
103
+ account: string;
104
+ bucketName: string;
105
+ path: string;
106
+ sourceConfig: SourceConfig;
107
+ lastModified?: number;
108
+ internal?: boolean;
109
+ }) => Promise<void>;
110
+ getInfo: (config: {
111
+ account: string;
112
+ bucketName: string;
113
+ path: string;
114
+ sourceConfig: SourceConfig;
115
+ includeTombstones?: boolean;
116
+ }) => Promise<{
78
117
  writeTime: number;
79
118
  size: number;
80
119
  } | undefined>;
81
- findInfo: (account: string, bucketName: string, prefix: string, config?: {
82
- shallow?: boolean;
83
- type?: "files" | "folders";
120
+ findInfo: (config: FindConfig & {
121
+ account: string;
122
+ bucketName: string;
123
+ prefix: string;
124
+ sourceConfig: SourceConfig;
125
+ }) => Promise<ArchiveFileInfo[]>;
126
+ getChangesAfter2: (config: {
127
+ account: string;
128
+ bucketName: string;
129
+ sourceConfig: SourceConfig;
130
+ time: number;
131
+ routes?: [number, number][];
84
132
  }) => Promise<ArchiveFileInfo[]>;
85
- getChangesAfter2: (account: string, bucketName: string, config: ChangesAfterConfig) => Promise<ArchiveFileInfo[]>;
86
- getArchivesConfig: (account: string, bucketName: string) => Promise<ArchivesConfig>;
87
- listBuckets: (account: string) => Promise<ServerBucketInfo[]>;
88
- getActiveBucket: (account: string, bucketName: string) => Promise<ActiveBucketInfo | string>;
89
- activateBucket: (account: string, bucketName: string) => Promise<ActiveBucketInfo | string>;
90
- clearWriteStats: (account: string) => Promise<{
133
+ getArchivesConfig: (config: {
134
+ account: string;
135
+ bucketName: string;
136
+ }) => Promise<ArchivesConfig>;
137
+ listBuckets: (config: {
138
+ account: string;
139
+ }) => Promise<ServerBucketInfo[]>;
140
+ getActiveBucket: (config: {
141
+ account: string;
142
+ bucketName: string;
143
+ }) => Promise<ActiveBucketInfo | string>;
144
+ activateBucket: (config: {
145
+ account: string;
146
+ bucketName: string;
147
+ }) => Promise<ActiveBucketInfo | string>;
148
+ clearWriteStats: (config: {
149
+ account: string;
150
+ }) => Promise<{
91
151
  clearedBuckets: number;
92
152
  }>;
93
- getAccessStats: (account: string) => Promise<AccessTotals>;
94
- getAccessSummaries: (account: string, config: {
153
+ getAccessStats: (config: {
154
+ account: string;
155
+ }) => Promise<AccessTotals>;
156
+ getAccessSummaries: (config: {
157
+ account: string;
95
158
  operation: string;
96
159
  maxCount: number;
97
160
  weightBySize?: boolean;
98
161
  }) => Promise<SummaryEntry<AccessSummaryState>[]>;
99
- getIndexInfo: (account: string, bucketName: string) => Promise<{
162
+ getIndexInfo: (config: {
163
+ account: string;
164
+ bucketName: string;
165
+ }) => Promise<{
100
166
  fileCount: number;
101
167
  byteCount: number;
102
168
  sources: {
@@ -105,11 +171,27 @@ export declare const RemoteStorageController: import("socket-function/SocketFunc
105
171
  byteCount: number;
106
172
  }[];
107
173
  } | undefined>;
108
- getSyncStatus: (account: string, bucketName: string) => Promise<ArchivesSyncStatus>;
109
- startLargeFile: (account: string, bucketName: string, path: string, lastModified?: number) => Promise<string>;
110
- uploadPart: (uploadId: string, data: Buffer) => Promise<void>;
111
- finishLargeFile: (uploadId: string) => Promise<void>;
112
- cancelLargeFile: (uploadId: string) => Promise<void>;
174
+ getSyncStatus: (config: {
175
+ account: string;
176
+ bucketName: string;
177
+ }) => Promise<ArchivesSyncStatus>;
178
+ startLargeFile: (config: {
179
+ account: string;
180
+ bucketName: string;
181
+ path: string;
182
+ sourceConfig: SourceConfig;
183
+ lastModified?: number;
184
+ }) => Promise<string>;
185
+ uploadPart: (config: {
186
+ uploadId: string;
187
+ data: Buffer;
188
+ }) => Promise<void>;
189
+ finishLargeFile: (config: {
190
+ uploadId: string;
191
+ }) => Promise<void>;
192
+ cancelLargeFile: (config: {
193
+ uploadId: string;
194
+ }) => Promise<void>;
113
195
  httpEntry: (config?: {
114
196
  requireCalls?: string[];
115
197
  cacheTime?: number;