@lossless.org/objectstorage 9.0.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/.smartconfig.json +71 -0
- package/dist_rust/ruststorage_linux_amd64 +0 -0
- package/dist_rust/ruststorage_linux_amd64.tsrust-build.json +14 -0
- package/dist_rust/ruststorage_linux_arm64 +0 -0
- package/dist_rust/ruststorage_linux_arm64.tsrust-build.json +14 -0
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/index.d.ts +741 -0
- package/dist_ts/index.js +885 -0
- package/dist_ts/paths.d.ts +4 -0
- package/dist_ts/paths.js +6 -0
- package/dist_ts/plugins.d.ts +9 -0
- package/dist_ts/plugins.js +13 -0
- package/license.md +21 -0
- package/package.json +77 -0
- package/readme.md +1430 -0
- package/third_party_licenses/base64-0.22.1/LICENSE-MIT +21 -0
- package/third_party_licenses/crc32fast-1.5.0/LICENSE-MIT +21 -0
- package/third_party_licenses/ring-0.17.14/INDEX.md +15 -0
- package/third_party_licenses/ring-0.17.14/LICENSE +9 -0
- package/third_party_licenses/ring-0.17.14/LICENSE-BoringSSL +272 -0
- package/third_party_licenses/ring-0.17.14/LICENSE-fiat +15 -0
- package/third_party_licenses/ring-0.17.14/LICENSE-once_cell-APACHE +201 -0
- package/third_party_licenses/ring-0.17.14/LICENSE-once_cell-MIT +23 -0
- package/third_party_licenses/ring-0.17.14/LICENSE-other-bits +13 -0
- package/ts/00_commitinfo_data.ts +8 -0
- package/ts/index.ts +1932 -0
- package/ts/paths.ts +11 -0
- package/ts/plugins.ts +17 -0
|
@@ -0,0 +1,741 @@
|
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
/**
|
|
3
|
+
* Authentication configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface IStorageCredential {
|
|
6
|
+
accessKeyId: string;
|
|
7
|
+
secretAccessKey: string;
|
|
8
|
+
bucketName?: string;
|
|
9
|
+
region?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IStorageCredentialMetadata {
|
|
12
|
+
accessKeyId: string;
|
|
13
|
+
bucketName?: string;
|
|
14
|
+
region?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Authentication configuration
|
|
18
|
+
*/
|
|
19
|
+
export interface IAuthConfig {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
credentials: IStorageCredential[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* CORS configuration
|
|
25
|
+
*/
|
|
26
|
+
export interface ICorsConfig {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
allowedOrigins?: string[];
|
|
29
|
+
allowedMethods?: string[];
|
|
30
|
+
allowedHeaders?: string[];
|
|
31
|
+
exposedHeaders?: string[];
|
|
32
|
+
maxAge?: number;
|
|
33
|
+
allowCredentials?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Logging configuration
|
|
37
|
+
*/
|
|
38
|
+
export interface ILoggingConfig {
|
|
39
|
+
level?: 'error' | 'warn' | 'info' | 'debug';
|
|
40
|
+
format?: 'text' | 'json';
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Request limits configuration
|
|
45
|
+
*/
|
|
46
|
+
export interface ILimitsConfig {
|
|
47
|
+
maxObjectSize?: number;
|
|
48
|
+
maxMetadataSize?: number;
|
|
49
|
+
requestTimeout?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Multipart upload configuration
|
|
53
|
+
*/
|
|
54
|
+
export interface IMultipartConfig {
|
|
55
|
+
expirationDays?: number;
|
|
56
|
+
cleanupIntervalMinutes?: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Server configuration
|
|
60
|
+
*/
|
|
61
|
+
export interface IServerConfig {
|
|
62
|
+
port?: number;
|
|
63
|
+
address?: string;
|
|
64
|
+
silent?: boolean;
|
|
65
|
+
region?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Storage configuration
|
|
69
|
+
*/
|
|
70
|
+
export interface ILocalFilesystemStoragePoolBackend {
|
|
71
|
+
kind: 'localFs';
|
|
72
|
+
}
|
|
73
|
+
export interface IMountedFilesystemStoragePoolBackend {
|
|
74
|
+
kind: 'mountedFs';
|
|
75
|
+
expectedFilesystemType: 'nfs' | 'smb';
|
|
76
|
+
expectedSource: string;
|
|
77
|
+
}
|
|
78
|
+
export type TStoragePoolBackend = ILocalFilesystemStoragePoolBackend | IMountedFilesystemStoragePoolBackend;
|
|
79
|
+
export interface IStoragePoolConfig {
|
|
80
|
+
id: string;
|
|
81
|
+
directory: string;
|
|
82
|
+
backend: TStoragePoolBackend;
|
|
83
|
+
}
|
|
84
|
+
export interface IMountedStoragePoolConfig extends IStoragePoolConfig {
|
|
85
|
+
backend: IMountedFilesystemStoragePoolBackend;
|
|
86
|
+
}
|
|
87
|
+
export interface IStorageConfig {
|
|
88
|
+
directory?: string;
|
|
89
|
+
cleanSlate?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* One ObjectStorage process serves one pool. `directory` remains as a
|
|
92
|
+
* compatibility alias and must resolve to the same path when both are set.
|
|
93
|
+
*/
|
|
94
|
+
pool?: IStoragePoolConfig;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Erasure coding configuration
|
|
98
|
+
*/
|
|
99
|
+
export interface IErasureConfig {
|
|
100
|
+
dataShards?: number;
|
|
101
|
+
parityShards?: number;
|
|
102
|
+
chunkSizeBytes?: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Drive configuration for multi-drive support
|
|
106
|
+
*/
|
|
107
|
+
export interface IDriveConfig {
|
|
108
|
+
paths: string[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Cluster configuration for distributed mode
|
|
112
|
+
*/
|
|
113
|
+
export interface IClusterConfig {
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
nodeId?: string;
|
|
116
|
+
quicPort?: number;
|
|
117
|
+
seedNodes?: string[];
|
|
118
|
+
erasure?: IErasureConfig;
|
|
119
|
+
drives?: IDriveConfig;
|
|
120
|
+
heartbeatIntervalMs?: number;
|
|
121
|
+
heartbeatTimeoutMs?: number;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Complete objectstorage configuration
|
|
125
|
+
*/
|
|
126
|
+
export interface IObjectStorageConfig {
|
|
127
|
+
server?: IServerConfig;
|
|
128
|
+
storage?: IStorageConfig;
|
|
129
|
+
auth?: IAuthConfig;
|
|
130
|
+
cors?: ICorsConfig;
|
|
131
|
+
logging?: ILoggingConfig;
|
|
132
|
+
limits?: ILimitsConfig;
|
|
133
|
+
multipart?: IMultipartConfig;
|
|
134
|
+
cluster?: IClusterConfig;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Logical bucket stats maintained by the Rust runtime.
|
|
138
|
+
* Values are initialized from native storage on startup and updated on objectstorage mutations.
|
|
139
|
+
*/
|
|
140
|
+
export interface IBucketSummary {
|
|
141
|
+
name: string;
|
|
142
|
+
objectCount: number;
|
|
143
|
+
totalSizeBytes: number;
|
|
144
|
+
creationDate?: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Filesystem-level capacity snapshot for the storage directory or configured drive path.
|
|
148
|
+
*/
|
|
149
|
+
export interface IStorageLocationSummary {
|
|
150
|
+
path: string;
|
|
151
|
+
totalBytes?: number;
|
|
152
|
+
availableBytes?: number;
|
|
153
|
+
usedBytes?: number;
|
|
154
|
+
pool?: IStoragePoolObservation;
|
|
155
|
+
}
|
|
156
|
+
export type TStoragePoolCheckStatus = 'passed' | 'failed' | 'notRun' | 'notApplicable';
|
|
157
|
+
export interface IStoragePoolCheck {
|
|
158
|
+
status: TStoragePoolCheckStatus;
|
|
159
|
+
reason?: string;
|
|
160
|
+
}
|
|
161
|
+
export interface IStoragePoolChecks {
|
|
162
|
+
directoryExists: IStoragePoolCheck;
|
|
163
|
+
exactMount: IStoragePoolCheck;
|
|
164
|
+
filesystemType: IStoragePoolCheck;
|
|
165
|
+
source: IStoragePoolCheck;
|
|
166
|
+
symlinkConfinement: IStoragePoolCheck;
|
|
167
|
+
remoteLocking: IStoragePoolCheck;
|
|
168
|
+
rootOwnership: IStoragePoolCheck;
|
|
169
|
+
sameFilesystem: IStoragePoolCheck;
|
|
170
|
+
lockContention: IStoragePoolCheck;
|
|
171
|
+
atomicDirectoryExchange: IStoragePoolCheck;
|
|
172
|
+
directoryFsync: IStoragePoolCheck;
|
|
173
|
+
providerIdentity: IStoragePoolCheck;
|
|
174
|
+
mountStable: IStoragePoolCheck;
|
|
175
|
+
}
|
|
176
|
+
export interface IStoragePoolFilesystemObservation {
|
|
177
|
+
filesystemType?: string;
|
|
178
|
+
source?: string;
|
|
179
|
+
mountPoint?: string;
|
|
180
|
+
mountId?: number;
|
|
181
|
+
device?: string;
|
|
182
|
+
networkBacked: boolean;
|
|
183
|
+
blockSizeBytes?: number;
|
|
184
|
+
readSizeBytes?: number;
|
|
185
|
+
writeSizeBytes?: number;
|
|
186
|
+
symlinkFollowingDisabled?: boolean;
|
|
187
|
+
remoteLockingMode?: 'serverCoordinated' | 'disabled' | 'localOnly' | 'unrecognized' | 'notApplicable';
|
|
188
|
+
}
|
|
189
|
+
export type TStoragePoolFailureCode = 'pathUnavailable' | 'mountInfoInvalid' | 'exactMountRequired' | 'filesystemTypeMismatch' | 'sourceMismatch' | 'mountChanged' | 'descriptorMismatch' | 'filesystemMagicMismatch' | 'symlinkFollowingAllowed' | 'lockingModeUnsafe' | 'activationPoisoned';
|
|
190
|
+
export interface IStoragePoolObservation {
|
|
191
|
+
schemaVersion: 1;
|
|
192
|
+
poolId: string;
|
|
193
|
+
directory: string;
|
|
194
|
+
role: 'controlAndBlob';
|
|
195
|
+
backendKind: 'localFs' | 'mountedFs';
|
|
196
|
+
filesystem: IStoragePoolFilesystemObservation;
|
|
197
|
+
checks: IStoragePoolChecks;
|
|
198
|
+
supported: boolean | null;
|
|
199
|
+
productionEligible: boolean;
|
|
200
|
+
activationValid?: boolean;
|
|
201
|
+
poisoned?: boolean;
|
|
202
|
+
poisonReason?: string;
|
|
203
|
+
failure?: {
|
|
204
|
+
code: TStoragePoolFailureCode;
|
|
205
|
+
message: string;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Runtime storage stats served by the Rust core without issuing S3 list calls.
|
|
210
|
+
*/
|
|
211
|
+
export interface IStorageStats {
|
|
212
|
+
bucketCount: number;
|
|
213
|
+
totalObjectCount: number;
|
|
214
|
+
totalStorageBytes: number;
|
|
215
|
+
buckets: IBucketSummary[];
|
|
216
|
+
storageDirectory: string;
|
|
217
|
+
storageLocations?: IStorageLocationSummary[];
|
|
218
|
+
}
|
|
219
|
+
export interface IStorageStopResult {
|
|
220
|
+
complete: true;
|
|
221
|
+
terminalError?: string;
|
|
222
|
+
}
|
|
223
|
+
export interface IBucketTenantInput {
|
|
224
|
+
bucketName: string;
|
|
225
|
+
accessKeyId?: string;
|
|
226
|
+
secretAccessKey?: string;
|
|
227
|
+
region?: string;
|
|
228
|
+
retention?: IBucketRetentionPolicyInput;
|
|
229
|
+
}
|
|
230
|
+
export interface IEnsureBucketTenantInput {
|
|
231
|
+
bucketName: string;
|
|
232
|
+
accessKeyId: string;
|
|
233
|
+
secretAccessKey: string;
|
|
234
|
+
region?: string;
|
|
235
|
+
retention?: IBucketRetentionPolicyInput;
|
|
236
|
+
fence?: IObjectStorageResourceFence;
|
|
237
|
+
}
|
|
238
|
+
export interface IDeleteBucketTenantInput {
|
|
239
|
+
bucketName: string;
|
|
240
|
+
accessKeyId?: string;
|
|
241
|
+
}
|
|
242
|
+
export interface IBucketTenantMetadata {
|
|
243
|
+
bucketName: string;
|
|
244
|
+
accessKeyId: string;
|
|
245
|
+
region?: string;
|
|
246
|
+
retention?: IBucketRetentionReceipt;
|
|
247
|
+
}
|
|
248
|
+
export interface IBucketRetentionPolicyInput {
|
|
249
|
+
mode: 'compliance';
|
|
250
|
+
policyId: string;
|
|
251
|
+
retentionDurationSeconds: number;
|
|
252
|
+
}
|
|
253
|
+
export interface IObjectRetentionReceipt {
|
|
254
|
+
mode: 'compliance';
|
|
255
|
+
policyId: string;
|
|
256
|
+
retentionDurationSeconds: number;
|
|
257
|
+
createdAt: number;
|
|
258
|
+
retainUntil: number;
|
|
259
|
+
payloadSha256: string;
|
|
260
|
+
metadataSha256: string;
|
|
261
|
+
etag: string;
|
|
262
|
+
}
|
|
263
|
+
export interface IBucketRetentionReceipt extends IBucketRetentionPolicyInput {
|
|
264
|
+
bucketName: string;
|
|
265
|
+
configuredAt: number;
|
|
266
|
+
sentinelKey: string;
|
|
267
|
+
sentinel: IObjectRetentionReceipt;
|
|
268
|
+
}
|
|
269
|
+
export interface IBucketRetentionCapability {
|
|
270
|
+
version: 1;
|
|
271
|
+
supported: boolean;
|
|
272
|
+
backend: 'standalone' | 'clustered';
|
|
273
|
+
modes: 'compliance'[];
|
|
274
|
+
atomicCreateOnly: boolean;
|
|
275
|
+
retainedMultipartSupported: false;
|
|
276
|
+
}
|
|
277
|
+
export interface IObjectStorageMigrationBinding {
|
|
278
|
+
migrationId: string;
|
|
279
|
+
authorityId: string;
|
|
280
|
+
logicalBucket: string;
|
|
281
|
+
sourceProviderIdentitySha256: string;
|
|
282
|
+
destinationProviderIdentitySha256: string;
|
|
283
|
+
destinationReceiptPublicKeyEd25519: string;
|
|
284
|
+
}
|
|
285
|
+
export type TObjectStorageSourceMigrationPhase = 'active' | 'sealed' | 'cutoverCommitted' | 'retired' | 'released';
|
|
286
|
+
export type TObjectStorageDestinationMigrationPhase = 'holding' | 'verified' | 'cutoverAuthorized' | 'published' | 'aborted';
|
|
287
|
+
export type TObjectStorageMigrationPhase = {
|
|
288
|
+
role: 'source';
|
|
289
|
+
phase: TObjectStorageSourceMigrationPhase;
|
|
290
|
+
} | {
|
|
291
|
+
role: 'destination';
|
|
292
|
+
phase: TObjectStorageDestinationMigrationPhase;
|
|
293
|
+
};
|
|
294
|
+
export interface IObjectStorageMigrationCreateInput {
|
|
295
|
+
binding: IObjectStorageMigrationBinding;
|
|
296
|
+
fenceToken: number;
|
|
297
|
+
opaqueCapability: string;
|
|
298
|
+
/** Required for source creation; omitted for destination creation. */
|
|
299
|
+
sourceCleanupAccessKeyId?: string;
|
|
300
|
+
}
|
|
301
|
+
export interface IObjectStorageMigrationTerminalReceipt {
|
|
302
|
+
version: 1;
|
|
303
|
+
kind: 'smartstorage.bucket-migration.terminal-receipt.standalone-v1';
|
|
304
|
+
binding: IObjectStorageMigrationBinding;
|
|
305
|
+
providerIdentitySha256: string;
|
|
306
|
+
fenceToken: number;
|
|
307
|
+
requestDigestSha256: string;
|
|
308
|
+
phase: TObjectStorageMigrationPhase;
|
|
309
|
+
manifestDigestSha256?: string;
|
|
310
|
+
counterpartTerminalReceiptSha256?: string;
|
|
311
|
+
signingPublicKeyEd25519: string;
|
|
312
|
+
signatureEd25519: string;
|
|
313
|
+
receiptSha256: string;
|
|
314
|
+
}
|
|
315
|
+
export interface IObjectStorageMigrationTransitionReceipt {
|
|
316
|
+
version: 1;
|
|
317
|
+
kind: 'smartstorage.bucket-migration.transition-receipt.standalone-v1';
|
|
318
|
+
binding: IObjectStorageMigrationBinding;
|
|
319
|
+
providerIdentitySha256: string;
|
|
320
|
+
fenceToken: number;
|
|
321
|
+
requestDigestSha256: string;
|
|
322
|
+
phase: TObjectStorageMigrationPhase;
|
|
323
|
+
manifestDigestSha256?: string;
|
|
324
|
+
terminalReceiptSha256?: string;
|
|
325
|
+
receiptSha256: string;
|
|
326
|
+
}
|
|
327
|
+
export interface IObjectStorageSourceMigrationTransitionInput {
|
|
328
|
+
binding: IObjectStorageMigrationBinding;
|
|
329
|
+
fenceToken: number;
|
|
330
|
+
opaqueCapability: string;
|
|
331
|
+
targetPhase: Exclude<TObjectStorageSourceMigrationPhase, 'active'>;
|
|
332
|
+
manifestDigestSha256?: string;
|
|
333
|
+
destinationAbortReceipt?: IObjectStorageMigrationTerminalReceipt;
|
|
334
|
+
}
|
|
335
|
+
export interface IObjectStorageDestinationMigrationTransitionInput {
|
|
336
|
+
binding: IObjectStorageMigrationBinding;
|
|
337
|
+
fenceToken: number;
|
|
338
|
+
opaqueCapability: string;
|
|
339
|
+
targetPhase: Exclude<TObjectStorageDestinationMigrationPhase, 'holding'>;
|
|
340
|
+
manifestDigestSha256?: string;
|
|
341
|
+
}
|
|
342
|
+
export interface IObjectStorageSourceMigrationCleanupInput {
|
|
343
|
+
binding: IObjectStorageMigrationBinding;
|
|
344
|
+
cleanupFenceToken: number;
|
|
345
|
+
opaqueCapability: string;
|
|
346
|
+
sourceRetiredReceiptSha256: string;
|
|
347
|
+
destinationPublishedReceipt: IObjectStorageMigrationTerminalReceipt;
|
|
348
|
+
resourceFence: IObjectStorageResourceFence;
|
|
349
|
+
accessKeyId: string;
|
|
350
|
+
}
|
|
351
|
+
export interface IObjectStorageSourceMigrationCleanupReceipt {
|
|
352
|
+
version: 1;
|
|
353
|
+
kind: 'smartstorage.bucket-migration.source-cleanup-receipt.standalone-v1';
|
|
354
|
+
binding: IObjectStorageMigrationBinding;
|
|
355
|
+
providerIdentitySha256: string;
|
|
356
|
+
cleanupFenceToken: number;
|
|
357
|
+
requestDigestSha256: string;
|
|
358
|
+
sourceRetiredReceiptSha256: string;
|
|
359
|
+
destinationPublishedReceiptSha256: string;
|
|
360
|
+
resourceFenceScopeId: string;
|
|
361
|
+
resourceFenceToken: number;
|
|
362
|
+
resourceFenceMutationId: string;
|
|
363
|
+
resourceFencePayloadSha256: string;
|
|
364
|
+
accessKeyIdSha256: string;
|
|
365
|
+
deleteResultSha256: string;
|
|
366
|
+
receiptSha256: string;
|
|
367
|
+
}
|
|
368
|
+
export interface IObjectStorageSourceMigrationCleanupInspection {
|
|
369
|
+
phase: 'requested' | 'completed';
|
|
370
|
+
cleanupFenceToken: number;
|
|
371
|
+
requestDigestSha256: string;
|
|
372
|
+
sourceRetiredReceiptSha256: string;
|
|
373
|
+
destinationPublishedReceipt: IObjectStorageMigrationTerminalReceipt;
|
|
374
|
+
resourceFence: IObjectStorageResourceFence;
|
|
375
|
+
accessKeyIdSha256: string;
|
|
376
|
+
deleteResultSha256?: string;
|
|
377
|
+
receipt?: IObjectStorageSourceMigrationCleanupReceipt;
|
|
378
|
+
}
|
|
379
|
+
export interface IObjectStorageMigrationInspection {
|
|
380
|
+
binding: IObjectStorageMigrationBinding;
|
|
381
|
+
providerIdentitySha256: string;
|
|
382
|
+
highestFenceToken: number;
|
|
383
|
+
requestDigestSha256: string;
|
|
384
|
+
phase: TObjectStorageMigrationPhase;
|
|
385
|
+
manifestDigestSha256?: string;
|
|
386
|
+
boundDestinationAbortReceipt?: IObjectStorageMigrationTerminalReceipt;
|
|
387
|
+
terminalReceipt?: IObjectStorageMigrationTerminalReceipt;
|
|
388
|
+
lastReceipt: IObjectStorageMigrationTransitionReceipt;
|
|
389
|
+
sourceCleanupAccessKeyIdSha256?: string;
|
|
390
|
+
sourceCleanup?: IObjectStorageSourceMigrationCleanupInspection;
|
|
391
|
+
}
|
|
392
|
+
export interface IObjectStorageBucketMigrationCapability {
|
|
393
|
+
version: 1;
|
|
394
|
+
supported: boolean;
|
|
395
|
+
backend: 'standalone' | 'clustered';
|
|
396
|
+
providerIdentitySha256?: string;
|
|
397
|
+
receiptPublicKeyEd25519?: string;
|
|
398
|
+
sourceSealDrainsMutations: boolean;
|
|
399
|
+
sourceReadsRemainAvailableWhileSealed: boolean;
|
|
400
|
+
destinationPublicationRequiresControllerCredentialHold: true;
|
|
401
|
+
sourceRetirementCleanupSupported: boolean;
|
|
402
|
+
sourceRetirementCleanupControllerRetryRequired: true;
|
|
403
|
+
sourceRetirementCleanupAutomaticStartupDeletion: false;
|
|
404
|
+
reason?: string;
|
|
405
|
+
}
|
|
406
|
+
export interface IBucketTenantDescriptor extends plugins.tsclass.storage.IS3Descriptor {
|
|
407
|
+
endpoint: string;
|
|
408
|
+
port: number;
|
|
409
|
+
region: string;
|
|
410
|
+
bucket: string;
|
|
411
|
+
bucketName: string;
|
|
412
|
+
accessKeyId: string;
|
|
413
|
+
secretAccessKey: string;
|
|
414
|
+
accessKey: string;
|
|
415
|
+
accessSecret: string;
|
|
416
|
+
useSsl: boolean;
|
|
417
|
+
ssl: boolean;
|
|
418
|
+
env: Record<string, string>;
|
|
419
|
+
/** Present when ensureBucketTenant completed under a resource fence. */
|
|
420
|
+
resourceFence?: IObjectStorageResourceFenceReceipt;
|
|
421
|
+
/** Engine-verified immutable-retention evidence when configured for the bucket. */
|
|
422
|
+
retention?: IBucketRetentionReceipt;
|
|
423
|
+
}
|
|
424
|
+
export interface IBucketExportObject {
|
|
425
|
+
key: string;
|
|
426
|
+
size: number;
|
|
427
|
+
md5: string;
|
|
428
|
+
metadata: Record<string, string>;
|
|
429
|
+
dataHex: string;
|
|
430
|
+
}
|
|
431
|
+
export interface IBucketExport {
|
|
432
|
+
format: 'smartstorage.bucket.v1';
|
|
433
|
+
bucketName: string;
|
|
434
|
+
exportedAt: number;
|
|
435
|
+
objects: IBucketExportObject[];
|
|
436
|
+
}
|
|
437
|
+
export interface IObjectStorageReplaceEffectivePayloadV1 {
|
|
438
|
+
version: 1;
|
|
439
|
+
kind: 'smartstorage.bucket.replace.v1';
|
|
440
|
+
bucketName: string;
|
|
441
|
+
accessKeyId?: string;
|
|
442
|
+
/** Request a durable write-publication barrier after provider replacement. */
|
|
443
|
+
holdPublication?: boolean;
|
|
444
|
+
source: IBucketExport;
|
|
445
|
+
}
|
|
446
|
+
export interface IObjectStorageExactDeleteEffectivePayloadV1 {
|
|
447
|
+
version: 1;
|
|
448
|
+
kind: 'smartstorage.bucket.delete.v1';
|
|
449
|
+
bucketName: string;
|
|
450
|
+
accessKeyId: string;
|
|
451
|
+
/** Request a durable write-publication barrier after provider deletion. */
|
|
452
|
+
holdPublication?: boolean;
|
|
453
|
+
}
|
|
454
|
+
export interface IObjectStorageEnsureEffectivePayloadV1 {
|
|
455
|
+
version: 1;
|
|
456
|
+
kind: 'smartstorage.bucket.ensure.v1';
|
|
457
|
+
bucketName: string;
|
|
458
|
+
accessKeyId: string;
|
|
459
|
+
/** Hashed before it is incorporated into the effective payload digest. */
|
|
460
|
+
secretAccessKey: string;
|
|
461
|
+
/** The effective region applied by the provider. */
|
|
462
|
+
region: string;
|
|
463
|
+
/** Optional immutable-retention intent applied as part of the fenced ensure. */
|
|
464
|
+
retention?: IBucketRetentionPolicyInput;
|
|
465
|
+
}
|
|
466
|
+
export type TObjectStorageResourceFenceEffectivePayloadV1 = IObjectStorageReplaceEffectivePayloadV1 | IObjectStorageExactDeleteEffectivePayloadV1 | IObjectStorageEnsureEffectivePayloadV1;
|
|
467
|
+
/**
|
|
468
|
+
* Computes the canonical provider-side effective payload digest for resource
|
|
469
|
+
* fencing v1. This intentionally excludes backup timestamps and source bucket
|
|
470
|
+
* names, matching the Rust engine's replacement and exact-delete profiles.
|
|
471
|
+
*/
|
|
472
|
+
export declare const computeObjectStorageResourceFenceEffectivePayloadSha256V1: (payloadArg: TObjectStorageResourceFenceEffectivePayloadV1) => string;
|
|
473
|
+
export interface IExportBucketInput {
|
|
474
|
+
bucketName: string;
|
|
475
|
+
}
|
|
476
|
+
export interface IImportBucketInput {
|
|
477
|
+
bucketName: string;
|
|
478
|
+
source: IBucketExport;
|
|
479
|
+
/** Exact exclusive bucket credential required by the fenced replacement. */
|
|
480
|
+
accessKeyId?: string;
|
|
481
|
+
fence?: IObjectStorageResourceFence;
|
|
482
|
+
/** Keep target writes closed until commitResourcePublication succeeds. */
|
|
483
|
+
holdPublication?: boolean;
|
|
484
|
+
}
|
|
485
|
+
export interface IDeleteBucketInput {
|
|
486
|
+
bucketName: string;
|
|
487
|
+
/**
|
|
488
|
+
* Exact bucket-scoped credential to revoke. When supplied, the access key
|
|
489
|
+
* is included in the durable mutation identity and retries treat an already
|
|
490
|
+
* absent key as a successful idempotent revocation. Omitting it retains the
|
|
491
|
+
* legacy data-only deletion behavior that preserves credentials and policy.
|
|
492
|
+
*/
|
|
493
|
+
accessKeyId?: string;
|
|
494
|
+
fence: IObjectStorageResourceFence;
|
|
495
|
+
/** Keep target writes closed until commitResourcePublication succeeds. */
|
|
496
|
+
holdPublication?: boolean;
|
|
497
|
+
}
|
|
498
|
+
export interface IObjectStorageResourceFence {
|
|
499
|
+
version: 1;
|
|
500
|
+
scopeId: string;
|
|
501
|
+
token: number;
|
|
502
|
+
mutationId: string;
|
|
503
|
+
payloadSha256: string;
|
|
504
|
+
}
|
|
505
|
+
export interface IObjectStorageResourceFenceReceipt extends IObjectStorageResourceFence {
|
|
506
|
+
kind: 'smartstorage.bucket.replace.v1' | 'smartstorage.bucket.delete.v1' | 'smartstorage.bucket.ensure.v1';
|
|
507
|
+
effectivePayloadSha256: string;
|
|
508
|
+
}
|
|
509
|
+
export interface IObjectStorageResourcePublicationBarrier {
|
|
510
|
+
version: 1;
|
|
511
|
+
kind: 'smartstorage.bucket.write-publication.v1';
|
|
512
|
+
providerRootIdentitySha256: string;
|
|
513
|
+
bucketName: string;
|
|
514
|
+
resourceIdSha256: string;
|
|
515
|
+
scopeId: string;
|
|
516
|
+
token: number;
|
|
517
|
+
mutationId: string;
|
|
518
|
+
mutationKind: 'smartstorage.bucket.replace.v1' | 'smartstorage.bucket.delete.v1';
|
|
519
|
+
payloadSha256: string;
|
|
520
|
+
effectivePayloadSha256: string;
|
|
521
|
+
mutationReceiptSha256: string;
|
|
522
|
+
/** Opaque CSPRNG capability. Never log or persist outside protected control state. */
|
|
523
|
+
commitCapability: string;
|
|
524
|
+
}
|
|
525
|
+
export interface IObjectStorageResourcePublicationReleaseReceipt {
|
|
526
|
+
version: 1;
|
|
527
|
+
kind: 'smartstorage.bucket.write-publication.release.v1';
|
|
528
|
+
providerRootIdentitySha256: string;
|
|
529
|
+
bucketName: string;
|
|
530
|
+
resourceIdSha256: string;
|
|
531
|
+
scopeId: string;
|
|
532
|
+
token: number;
|
|
533
|
+
mutationId: string;
|
|
534
|
+
mutationKind: 'smartstorage.bucket.replace.v1' | 'smartstorage.bucket.delete.v1';
|
|
535
|
+
payloadSha256: string;
|
|
536
|
+
effectivePayloadSha256: string;
|
|
537
|
+
mutationReceiptSha256: string;
|
|
538
|
+
barrierSha256: string;
|
|
539
|
+
}
|
|
540
|
+
export interface ICommitObjectStorageResourcePublicationInput {
|
|
541
|
+
barrier: IObjectStorageResourcePublicationBarrier;
|
|
542
|
+
resourceFenceReceipt: IObjectStorageResourceFenceReceipt;
|
|
543
|
+
}
|
|
544
|
+
export interface IObjectStorageBucketMutationResult {
|
|
545
|
+
bucketName: string;
|
|
546
|
+
objects?: number;
|
|
547
|
+
totalBytes?: number;
|
|
548
|
+
bucketDeleted?: boolean;
|
|
549
|
+
/**
|
|
550
|
+
* Credentials removed during the completing attempt. A crash-recovery
|
|
551
|
+
* retry can report zero after the exact credential was already persisted
|
|
552
|
+
* as absent.
|
|
553
|
+
*/
|
|
554
|
+
deletedCredentials?: number;
|
|
555
|
+
credentialsPreserved?: boolean;
|
|
556
|
+
policyPreserved?: boolean;
|
|
557
|
+
resourceFence?: IObjectStorageResourceFenceReceipt;
|
|
558
|
+
resourcePublicationBarrier?: IObjectStorageResourcePublicationBarrier;
|
|
559
|
+
resourcePublicationRelease?: IObjectStorageResourcePublicationReleaseReceipt;
|
|
560
|
+
}
|
|
561
|
+
export interface IObjectStorageResourceFencingCapability {
|
|
562
|
+
version: 1;
|
|
563
|
+
supported: boolean;
|
|
564
|
+
requiresDrain: true;
|
|
565
|
+
publicationHoldVersion: 1;
|
|
566
|
+
publicationHoldSupported: boolean;
|
|
567
|
+
publicationHoldRequiresExternalDrain: false;
|
|
568
|
+
reason?: string;
|
|
569
|
+
}
|
|
570
|
+
export interface IObjectStorageHealth {
|
|
571
|
+
ok: boolean;
|
|
572
|
+
running: boolean;
|
|
573
|
+
storageDirectory: string;
|
|
574
|
+
storageLocations?: IStorageLocationSummary[];
|
|
575
|
+
auth: {
|
|
576
|
+
enabled: boolean;
|
|
577
|
+
credentialCount: number;
|
|
578
|
+
tenantCredentialCount: number;
|
|
579
|
+
};
|
|
580
|
+
bucketCount: number;
|
|
581
|
+
objectCount: number;
|
|
582
|
+
totalBytes: number;
|
|
583
|
+
cluster: IClusterHealth;
|
|
584
|
+
resourceFencingVersion: 1;
|
|
585
|
+
resourceFencingSupported: boolean;
|
|
586
|
+
resourceFencingRequiresDrain: true;
|
|
587
|
+
resourcePublicationHoldVersion: 1;
|
|
588
|
+
resourcePublicationHoldSupported: boolean;
|
|
589
|
+
resourcePublicationHoldRequiresExternalDrain: false;
|
|
590
|
+
resourceFencingReason?: string;
|
|
591
|
+
}
|
|
592
|
+
export declare const objectStorageResourceFenceErrorCodes: readonly ["EFENCE_REQUIRED", "EFENCE_STALE", "EFENCE_SCOPE_MISMATCH", "EFENCE_UNSUPPORTED", "EFENCE_MUTATION_MISMATCH", "EFENCE_STATE_CORRUPT", "EFENCE_RECEIPT_LIMIT", "EFENCE_BUSY", "EFENCE_OWNERSHIP_MISMATCH", "EFENCE_PUBLICATION_HELD", "EFENCE_PUBLICATION_MISMATCH", "EFENCE_PUBLICATION_CAPABILITY"];
|
|
593
|
+
export type TObjectStorageResourceFenceErrorCode = (typeof objectStorageResourceFenceErrorCodes)[number];
|
|
594
|
+
export declare class ObjectStorageResourceFenceError extends Error {
|
|
595
|
+
readonly code: TObjectStorageResourceFenceErrorCode;
|
|
596
|
+
constructor(codeArg: TObjectStorageResourceFenceErrorCode, messageArg: string, causeArg?: unknown);
|
|
597
|
+
}
|
|
598
|
+
export interface IObjectStorageMetrics {
|
|
599
|
+
bucketCount: number;
|
|
600
|
+
objectCount: number;
|
|
601
|
+
totalBytes: number;
|
|
602
|
+
authCredentialCount: number;
|
|
603
|
+
tenantCredentialCount: number;
|
|
604
|
+
clusterEnabled: boolean;
|
|
605
|
+
prometheusText: string;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Known peer status from the local node's current cluster view.
|
|
609
|
+
*/
|
|
610
|
+
export interface IClusterPeerHealth {
|
|
611
|
+
nodeId: string;
|
|
612
|
+
status: 'online' | 'suspect' | 'offline';
|
|
613
|
+
quicAddress?: string;
|
|
614
|
+
s3Address?: string;
|
|
615
|
+
driveCount?: number;
|
|
616
|
+
lastHeartbeat?: number;
|
|
617
|
+
missedHeartbeats?: number;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Local drive health as measured by objectstorage's runtime probes.
|
|
621
|
+
*/
|
|
622
|
+
export interface IClusterDriveHealth {
|
|
623
|
+
index: number;
|
|
624
|
+
path: string;
|
|
625
|
+
status: 'online' | 'degraded' | 'offline' | 'healing';
|
|
626
|
+
totalBytes?: number;
|
|
627
|
+
usedBytes?: number;
|
|
628
|
+
availableBytes?: number;
|
|
629
|
+
errorCount?: number;
|
|
630
|
+
lastError?: string;
|
|
631
|
+
lastCheck?: number;
|
|
632
|
+
erasureSetId?: number;
|
|
633
|
+
}
|
|
634
|
+
export interface IClusterErasureHealth {
|
|
635
|
+
dataShards: number;
|
|
636
|
+
parityShards: number;
|
|
637
|
+
chunkSizeBytes: number;
|
|
638
|
+
totalShards: number;
|
|
639
|
+
readQuorum: number;
|
|
640
|
+
writeQuorum: number;
|
|
641
|
+
erasureSetCount: number;
|
|
642
|
+
}
|
|
643
|
+
export interface IClusterRepairHealth {
|
|
644
|
+
active: boolean;
|
|
645
|
+
scanIntervalMs?: number;
|
|
646
|
+
lastRunStartedAt?: number;
|
|
647
|
+
lastRunCompletedAt?: number;
|
|
648
|
+
lastDurationMs?: number;
|
|
649
|
+
shardsChecked?: number;
|
|
650
|
+
shardsHealed?: number;
|
|
651
|
+
failed?: number;
|
|
652
|
+
lastError?: string;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Cluster runtime health from the Rust core.
|
|
656
|
+
* When clustering is disabled, the response is `{ enabled: false }`.
|
|
657
|
+
*/
|
|
658
|
+
export interface IClusterHealth {
|
|
659
|
+
enabled: boolean;
|
|
660
|
+
nodeId?: string;
|
|
661
|
+
quorumHealthy?: boolean;
|
|
662
|
+
majorityHealthy?: boolean;
|
|
663
|
+
peers?: IClusterPeerHealth[];
|
|
664
|
+
drives?: IClusterDriveHealth[];
|
|
665
|
+
erasure?: IClusterErasureHealth;
|
|
666
|
+
repairs?: IClusterRepairHealth;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Main ObjectStorage class - production-ready S3-compatible storage server
|
|
670
|
+
*/
|
|
671
|
+
export declare class ObjectStorage {
|
|
672
|
+
static createAndStart(configArg?: IObjectStorageConfig): Promise<ObjectStorage>;
|
|
673
|
+
static probeStoragePool(poolArg: IMountedStoragePoolConfig): Promise<IStoragePoolObservation>;
|
|
674
|
+
config: Required<IObjectStorageConfig>;
|
|
675
|
+
private localBinaryPaths;
|
|
676
|
+
private bridge;
|
|
677
|
+
private running;
|
|
678
|
+
private completedStopResult;
|
|
679
|
+
private startPromise;
|
|
680
|
+
private stopPromise;
|
|
681
|
+
private bridgeOwned;
|
|
682
|
+
private stopRequested;
|
|
683
|
+
private stopCompleted;
|
|
684
|
+
constructor(configArg?: IObjectStorageConfig);
|
|
685
|
+
private ensureLocalBinariesExecutable;
|
|
686
|
+
start(): Promise<void>;
|
|
687
|
+
private startInternal;
|
|
688
|
+
getStorageDescriptor(optionsArg?: Partial<plugins.tsclass.storage.IS3Descriptor>): Promise<plugins.tsclass.storage.IS3Descriptor>;
|
|
689
|
+
private getEndpoint;
|
|
690
|
+
private buildBucketTenantDescriptor;
|
|
691
|
+
private assertTenantAuthEnabled;
|
|
692
|
+
createBucket(bucketNameArg: string): Promise<{
|
|
693
|
+
name: string;
|
|
694
|
+
}>;
|
|
695
|
+
createBucketTenant(tenantArg: IBucketTenantInput): Promise<IBucketTenantDescriptor>;
|
|
696
|
+
ensureBucketTenant(tenantArg: IEnsureBucketTenantInput): Promise<IBucketTenantDescriptor>;
|
|
697
|
+
deleteBucketTenant(tenantArg: IDeleteBucketTenantInput): Promise<void>;
|
|
698
|
+
rotateBucketTenantCredentials(tenantArg: IBucketTenantInput): Promise<IBucketTenantDescriptor>;
|
|
699
|
+
listBucketTenants(): Promise<IBucketTenantMetadata[]>;
|
|
700
|
+
getBucketTenantDescriptor(optionsArg: {
|
|
701
|
+
bucketName: string;
|
|
702
|
+
}): Promise<IBucketTenantDescriptor>;
|
|
703
|
+
getBucketRetentionCapability(): Promise<IBucketRetentionCapability>;
|
|
704
|
+
getBucketRetentionReceipt(optionsArg: {
|
|
705
|
+
bucketName: string;
|
|
706
|
+
}): Promise<IBucketRetentionReceipt | null>;
|
|
707
|
+
getBucketMigrationCapability(): Promise<IObjectStorageBucketMigrationCapability>;
|
|
708
|
+
createSourceMigration(optionsArg: IObjectStorageMigrationCreateInput): Promise<IObjectStorageMigrationTransitionReceipt>;
|
|
709
|
+
createDestinationMigration(optionsArg: IObjectStorageMigrationCreateInput): Promise<IObjectStorageMigrationTransitionReceipt>;
|
|
710
|
+
transitionSourceMigration(optionsArg: IObjectStorageSourceMigrationTransitionInput): Promise<IObjectStorageMigrationTransitionReceipt>;
|
|
711
|
+
transitionDestinationMigration(optionsArg: IObjectStorageDestinationMigrationTransitionInput): Promise<IObjectStorageMigrationTransitionReceipt>;
|
|
712
|
+
cleanupSourceMigration(optionsArg: IObjectStorageSourceMigrationCleanupInput): Promise<IObjectStorageSourceMigrationCleanupReceipt>;
|
|
713
|
+
inspectBucketMigration(optionsArg: {
|
|
714
|
+
migrationId: string;
|
|
715
|
+
}): Promise<IObjectStorageMigrationInspection | null>;
|
|
716
|
+
exportBucket(optionsArg: IExportBucketInput): Promise<IBucketExport>;
|
|
717
|
+
importBucket(optionsArg: IImportBucketInput): Promise<IObjectStorageBucketMutationResult>;
|
|
718
|
+
deleteBucket(optionsArg: IDeleteBucketInput): Promise<IObjectStorageBucketMutationResult>;
|
|
719
|
+
commitResourcePublication(optionsArg: ICommitObjectStorageResourcePublicationInput): Promise<IObjectStorageResourcePublicationReleaseReceipt>;
|
|
720
|
+
getResourceFencingCapability(): Promise<IObjectStorageResourceFencingCapability>;
|
|
721
|
+
getStorageStats(): Promise<IStorageStats>;
|
|
722
|
+
getStoragePoolDiagnostic(): Promise<IStoragePoolObservation | null>;
|
|
723
|
+
listBucketSummaries(): Promise<IBucketSummary[]>;
|
|
724
|
+
listCredentials(): Promise<IStorageCredentialMetadata[]>;
|
|
725
|
+
/**
|
|
726
|
+
* Trusted process-local administrative override. Resource lifecycle code
|
|
727
|
+
* must use fenced ensure/delete instead; completed exact receipts fail closed
|
|
728
|
+
* if this override introduces ownership or credential-material drift.
|
|
729
|
+
*/
|
|
730
|
+
replaceCredentials(credentials: IStorageCredential[]): Promise<void>;
|
|
731
|
+
getClusterHealth(): Promise<IClusterHealth>;
|
|
732
|
+
getHealth(): Promise<IObjectStorageHealth>;
|
|
733
|
+
getMetrics(): Promise<IObjectStorageMetrics>;
|
|
734
|
+
/**
|
|
735
|
+
* Retains the Rust bridge when shutdown is incomplete so a later call can
|
|
736
|
+
* retry ownership draining. Completed terminal errors kill the bridge before
|
|
737
|
+
* they are rethrown.
|
|
738
|
+
*/
|
|
739
|
+
stop(): Promise<void>;
|
|
740
|
+
private stopInternal;
|
|
741
|
+
}
|