zerobucket 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -20
- package/dist/bin.js +2506 -0
- package/dist/{chunk-W2C37XYV.js → chunk-SCPC3QDR.js} +1 -1
- package/dist/{client-WZ4VRCPi.d.cts → client-C7xs1dlr.d.cts} +49 -1
- package/dist/{client-WZ4VRCPi.d.ts → client-C7xs1dlr.d.ts} +49 -1
- package/dist/http.d.cts +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +456 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +450 -13
- package/dist/index.js.map +1 -1
- package/package.json +16 -4
- /package/dist/{chunk-W2C37XYV.js.map → chunk-SCPC3QDR.js.map} +0 -0
|
@@ -125,6 +125,50 @@ interface StreamOptions$1 extends CallOptions {
|
|
|
125
125
|
end: number;
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
+
/** Filters for maintenance listings (CLI `verify` / `tier`). All optional; combined with AND. */
|
|
129
|
+
interface ImageListOptions {
|
|
130
|
+
/** Return a random sample of this many images instead of all of them. */
|
|
131
|
+
sample?: number;
|
|
132
|
+
limit?: number;
|
|
133
|
+
/** Only images with size_bytes >= this. */
|
|
134
|
+
minSize?: number;
|
|
135
|
+
/** Only images created at least this many days ago. */
|
|
136
|
+
olderThanDays?: number;
|
|
137
|
+
/** Only images whose bytes are still in the database (not tiered). */
|
|
138
|
+
onlyUntiered?: boolean;
|
|
139
|
+
}
|
|
140
|
+
interface ImageListEntry {
|
|
141
|
+
id: string;
|
|
142
|
+
/** Bytes live in object storage, not in the database. */
|
|
143
|
+
tiered: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** Storage statistics for `zerobucket info`. */
|
|
146
|
+
interface StorageInfo {
|
|
147
|
+
mode: "classic" | "dedup";
|
|
148
|
+
/** Number of images (references, in dedup mode). */
|
|
149
|
+
count: number;
|
|
150
|
+
/** Sum of every image's size_bytes as recorded by the application (logical size). */
|
|
151
|
+
totalBytes: number;
|
|
152
|
+
oldest: string | null;
|
|
153
|
+
newest: string | null;
|
|
154
|
+
/** Human-readable on-disk size, if the database can tell. */
|
|
155
|
+
onDisk: string | null;
|
|
156
|
+
byFormat: {
|
|
157
|
+
mimeType: string;
|
|
158
|
+
count: number;
|
|
159
|
+
bytes: number;
|
|
160
|
+
}[];
|
|
161
|
+
/** Classic mode: images currently living in object storage. */
|
|
162
|
+
tiered?: {
|
|
163
|
+
count: number;
|
|
164
|
+
bytes: number;
|
|
165
|
+
};
|
|
166
|
+
/** Dedup mode: distinct stored blobs and the bytes they physically occupy. */
|
|
167
|
+
dedup?: {
|
|
168
|
+
blobs: number;
|
|
169
|
+
storedBytes: number;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
128
172
|
interface StorageBackend {
|
|
129
173
|
/** Resolve once the backend is connected and migrated. Safe to call repeatedly. */
|
|
130
174
|
ready(): Promise<void>;
|
|
@@ -153,6 +197,10 @@ interface StorageBackend {
|
|
|
153
197
|
duplicateReferencesFound: number;
|
|
154
198
|
alreadyMigrated: number;
|
|
155
199
|
}>;
|
|
200
|
+
/** Maintenance: storage statistics, or null if the tables do not exist yet. */
|
|
201
|
+
getInfo?(): Promise<StorageInfo | null>;
|
|
202
|
+
/** Maintenance: list ids matching the filters (oldest first, or random when sampling). */
|
|
203
|
+
listImages?(opts?: ImageListOptions): Promise<ImageListEntry[]>;
|
|
156
204
|
close(): Promise<void>;
|
|
157
205
|
}
|
|
158
206
|
|
|
@@ -422,4 +470,4 @@ declare function readInput(image: ImageInput, filename: string | undefined, maxB
|
|
|
422
470
|
filename: string | undefined;
|
|
423
471
|
}>;
|
|
424
472
|
|
|
425
|
-
export { type BatchDeleteResult as B, type CallOptions as C, DEFAULT_MAX_BYTES as D, type GetOptions as G, type
|
|
473
|
+
export { type BatchDeleteResult as B, type CallOptions as C, DEFAULT_MAX_BYTES as D, type GetOptions as G, type ImageListOptions as I, type OperationEvent as O, type PreparedRow as P, type Queryable as Q, type StorageBackend as S, type ValidatedContent as V, type WritableLike as W, ZeroBucket as Z, type ObjectStorageLike as a, type StoredRecord as b, type StoredRecordMetadata as c, type StreamOptions$1 as d, type StorageInfo as e, type ImageListEntry as f, type ContentValidator as g, type BatchGetResult as h, type BatchPutResult as i, type BeforeGetHook as j, type BeforePutHook as k, type Connection as l, type Image as m, type ImageInput as n, type ImageMetadata as o, ObjectStorage as p, type ObjectStorageOptions as q, type OptimizationResult as r, type OptimizeOptions as s, type PutManyOptions as t, type PutOptions as u, type SqliteDatabaseLike as v, type StreamOptions as w, type ZeroBucketOptions as x, optimizeImage as y, readInput as z };
|
|
@@ -125,6 +125,50 @@ interface StreamOptions$1 extends CallOptions {
|
|
|
125
125
|
end: number;
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
+
/** Filters for maintenance listings (CLI `verify` / `tier`). All optional; combined with AND. */
|
|
129
|
+
interface ImageListOptions {
|
|
130
|
+
/** Return a random sample of this many images instead of all of them. */
|
|
131
|
+
sample?: number;
|
|
132
|
+
limit?: number;
|
|
133
|
+
/** Only images with size_bytes >= this. */
|
|
134
|
+
minSize?: number;
|
|
135
|
+
/** Only images created at least this many days ago. */
|
|
136
|
+
olderThanDays?: number;
|
|
137
|
+
/** Only images whose bytes are still in the database (not tiered). */
|
|
138
|
+
onlyUntiered?: boolean;
|
|
139
|
+
}
|
|
140
|
+
interface ImageListEntry {
|
|
141
|
+
id: string;
|
|
142
|
+
/** Bytes live in object storage, not in the database. */
|
|
143
|
+
tiered: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** Storage statistics for `zerobucket info`. */
|
|
146
|
+
interface StorageInfo {
|
|
147
|
+
mode: "classic" | "dedup";
|
|
148
|
+
/** Number of images (references, in dedup mode). */
|
|
149
|
+
count: number;
|
|
150
|
+
/** Sum of every image's size_bytes as recorded by the application (logical size). */
|
|
151
|
+
totalBytes: number;
|
|
152
|
+
oldest: string | null;
|
|
153
|
+
newest: string | null;
|
|
154
|
+
/** Human-readable on-disk size, if the database can tell. */
|
|
155
|
+
onDisk: string | null;
|
|
156
|
+
byFormat: {
|
|
157
|
+
mimeType: string;
|
|
158
|
+
count: number;
|
|
159
|
+
bytes: number;
|
|
160
|
+
}[];
|
|
161
|
+
/** Classic mode: images currently living in object storage. */
|
|
162
|
+
tiered?: {
|
|
163
|
+
count: number;
|
|
164
|
+
bytes: number;
|
|
165
|
+
};
|
|
166
|
+
/** Dedup mode: distinct stored blobs and the bytes they physically occupy. */
|
|
167
|
+
dedup?: {
|
|
168
|
+
blobs: number;
|
|
169
|
+
storedBytes: number;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
128
172
|
interface StorageBackend {
|
|
129
173
|
/** Resolve once the backend is connected and migrated. Safe to call repeatedly. */
|
|
130
174
|
ready(): Promise<void>;
|
|
@@ -153,6 +197,10 @@ interface StorageBackend {
|
|
|
153
197
|
duplicateReferencesFound: number;
|
|
154
198
|
alreadyMigrated: number;
|
|
155
199
|
}>;
|
|
200
|
+
/** Maintenance: storage statistics, or null if the tables do not exist yet. */
|
|
201
|
+
getInfo?(): Promise<StorageInfo | null>;
|
|
202
|
+
/** Maintenance: list ids matching the filters (oldest first, or random when sampling). */
|
|
203
|
+
listImages?(opts?: ImageListOptions): Promise<ImageListEntry[]>;
|
|
156
204
|
close(): Promise<void>;
|
|
157
205
|
}
|
|
158
206
|
|
|
@@ -422,4 +470,4 @@ declare function readInput(image: ImageInput, filename: string | undefined, maxB
|
|
|
422
470
|
filename: string | undefined;
|
|
423
471
|
}>;
|
|
424
472
|
|
|
425
|
-
export { type BatchDeleteResult as B, type CallOptions as C, DEFAULT_MAX_BYTES as D, type GetOptions as G, type
|
|
473
|
+
export { type BatchDeleteResult as B, type CallOptions as C, DEFAULT_MAX_BYTES as D, type GetOptions as G, type ImageListOptions as I, type OperationEvent as O, type PreparedRow as P, type Queryable as Q, type StorageBackend as S, type ValidatedContent as V, type WritableLike as W, ZeroBucket as Z, type ObjectStorageLike as a, type StoredRecord as b, type StoredRecordMetadata as c, type StreamOptions$1 as d, type StorageInfo as e, type ImageListEntry as f, type ContentValidator as g, type BatchGetResult as h, type BatchPutResult as i, type BeforeGetHook as j, type BeforePutHook as k, type Connection as l, type Image as m, type ImageInput as n, type ImageMetadata as o, ObjectStorage as p, type ObjectStorageOptions as q, type OptimizationResult as r, type OptimizeOptions as s, type PutManyOptions as t, type PutOptions as u, type SqliteDatabaseLike as v, type StreamOptions as w, type ZeroBucketOptions as x, optimizeImage as y, readInput as z };
|
package/dist/http.d.cts
CHANGED
package/dist/http.d.ts
CHANGED