zerobucket 0.6.1 → 0.8.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 +80 -9
- package/dist/bin.js +984 -5
- package/dist/{client-C7xs1dlr.d.cts → client-XQ22b1l3.d.cts} +36 -4
- package/dist/{client-C7xs1dlr.d.ts → client-XQ22b1l3.d.ts} +36 -4
- package/dist/http.d.cts +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/index.cjs +1211 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +129 -3
- package/dist/index.d.ts +129 -3
- package/dist/index.js +991 -2
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StorageBackend, O as OperationEvent, a as ObjectStorageLike, P as PreparedRow, C as CallOptions, b as StoredRecord, c as StoredRecordMetadata, d as StreamOptions, e as StorageInfo, I as ImageListOptions, f as ImageListEntry, g as ContentValidator, V as ValidatedContent } from './client-
|
|
2
|
-
export { B as BatchDeleteResult, h as BatchGetResult, i as BatchPutResult, j as BeforeGetHook, k as BeforePutHook, l as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, m as Image, n as ImageInput, o as ImageMetadata, p as
|
|
1
|
+
import { S as StorageBackend, O as OperationEvent, a as ObjectStorageLike, P as PreparedRow, C as CallOptions, b as StoredRecord, c as StoredRecordMetadata, d as StreamOptions, e as StorageInfo, I as ImageListOptions, f as ImageListEntry, M as MysqlPoolLike, g as ContentValidator, V as ValidatedContent } from './client-XQ22b1l3.cjs';
|
|
2
|
+
export { B as BatchDeleteResult, h as BatchGetResult, i as BatchPutResult, j as BeforeGetHook, k as BeforePutHook, l as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, m as Image, n as ImageInput, o as ImageMetadata, p as MysqlPoolConnectionLike, q as MysqlQueryable, r as ObjectStorage, s as ObjectStorageOptions, t as OptimizationResult, u as OptimizeOptions, v as PutManyOptions, w as PutOptions, Q as Queryable, x as SqliteDatabaseLike, y as StreamOptions, W as WritableLike, Z as ZeroBucket, z as ZeroBucketOptions, A as optimizeImage, E as readInput } from './client-XQ22b1l3.cjs';
|
|
3
3
|
import { Pool } from 'pg';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -275,6 +275,132 @@ declare class SQLiteBackend implements StorageBackend {
|
|
|
275
275
|
tierToObjectStorage(id: string, { connection }?: CallOptions): Promise<boolean | null>;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
interface MySQLBackendOptions {
|
|
279
|
+
/** `mysql://user:password@host:3306/database` (`mariadb://` is accepted too). Required unless `pool` is given. */
|
|
280
|
+
connectionString?: string;
|
|
281
|
+
/** Bring your own `mysql2/promise` Pool (not closed by `close()`). Pool sizing options are then ignored. */
|
|
282
|
+
pool?: MysqlPoolLike;
|
|
283
|
+
/** Create the schema on first use. Default true. */
|
|
284
|
+
autoMigrate?: boolean;
|
|
285
|
+
/** Retries for transient errors on pooled calls. Default 3; 0 disables. */
|
|
286
|
+
maxRetries?: number;
|
|
287
|
+
/** Base for exponential backoff with jitter (capped at 2s). Default 100. */
|
|
288
|
+
retryBaseDelayMs?: number;
|
|
289
|
+
/** Accepted for parity with the other backends. mysql2 opens connections on demand, so there is no minimum to hold. */
|
|
290
|
+
poolMinSize?: number;
|
|
291
|
+
/** Maximum simultaneous connections. Default 5. */
|
|
292
|
+
poolMaxSize?: number;
|
|
293
|
+
/** Max wait for a pooled connection (also the TCP connect timeout). Default 10000. */
|
|
294
|
+
poolTimeoutMs?: number;
|
|
295
|
+
onOperation?: (event: OperationEvent) => void;
|
|
296
|
+
/** Enables transparent reads of tiered rows and `tierToObjectStorage()`. */
|
|
297
|
+
objectStorage?: ObjectStorageLike;
|
|
298
|
+
/**
|
|
299
|
+
* Content-addressed storage: identical bytes are stored once and shared by every image that has them
|
|
300
|
+
* (reference counted). Same tables as the Python package's dedup mode. Cannot be combined with
|
|
301
|
+
* `objectStorage` (a blob may be shared by many images).
|
|
302
|
+
*/
|
|
303
|
+
dedup?: boolean;
|
|
304
|
+
}
|
|
305
|
+
declare class MySQLBackend implements StorageBackend {
|
|
306
|
+
private readonly opts;
|
|
307
|
+
private pool;
|
|
308
|
+
private readonly ownsPool;
|
|
309
|
+
private readyPromise;
|
|
310
|
+
private closed;
|
|
311
|
+
private readonly maxRetries;
|
|
312
|
+
private readonly retryBaseDelayMs;
|
|
313
|
+
private readonly poolTimeoutMs;
|
|
314
|
+
private readonly autoMigrate;
|
|
315
|
+
private readonly dedup;
|
|
316
|
+
private readonly sql;
|
|
317
|
+
constructor(opts: MySQLBackendOptions);
|
|
318
|
+
ready(): Promise<void>;
|
|
319
|
+
private init;
|
|
320
|
+
/**
|
|
321
|
+
* Create the schema if missing, under a server-side named lock so concurrent first callers (in this
|
|
322
|
+
* or any other process) run the DDL one at a time. Every step checks before it changes anything, so
|
|
323
|
+
* re-running is a no-op.
|
|
324
|
+
*/
|
|
325
|
+
private migrate;
|
|
326
|
+
/** Dedup tables, created only if missing (same no-needless-DDL rule as the classic table). */
|
|
327
|
+
private migrateDedup;
|
|
328
|
+
close(): Promise<void>;
|
|
329
|
+
private emit;
|
|
330
|
+
/** Wait for a pool slot, but never longer than poolTimeoutMs. */
|
|
331
|
+
private acquire;
|
|
332
|
+
/**
|
|
333
|
+
* Run `work` on a pooled connection. `tx` wraps it in a transaction. Transient failures retry the
|
|
334
|
+
* WHOLE closure on a fresh connection after a full rollback.
|
|
335
|
+
*/
|
|
336
|
+
private runPooled;
|
|
337
|
+
/**
|
|
338
|
+
* Run `work` and return its result, emitting exactly one OperationEvent.
|
|
339
|
+
*
|
|
340
|
+
* connection given -> run once on it; no retry, and no commit/rollback of the caller's transaction.
|
|
341
|
+
* connection absent -> pooled, retried (see runPooled).
|
|
342
|
+
*/
|
|
343
|
+
private run;
|
|
344
|
+
/**
|
|
345
|
+
* Make multi-statement work all-or-nothing on a CALLER-supplied connection.
|
|
346
|
+
*
|
|
347
|
+
* Is a transaction open? SAVEPOINT followed by ROLLBACK TO SAVEPOINT succeeds only inside one (in
|
|
348
|
+
* autocommit mode the savepoint is gone before the next statement and the rollback fails with 1305).
|
|
349
|
+
* - Open -> reuse that SAVEPOINT: a failure undoes only our work; success joins the caller's transaction.
|
|
350
|
+
* - None -> START TRANSACTION and COMMIT our own, so a failure can never leave half-applied state.
|
|
351
|
+
*/
|
|
352
|
+
private atomic;
|
|
353
|
+
put(row: PreparedRow, { connection }?: CallOptions): Promise<string>;
|
|
354
|
+
putMany(rows: PreparedRow[], { connection }?: CallOptions): Promise<string[]>;
|
|
355
|
+
get(id: string, { connection }?: CallOptions): Promise<StoredRecord | null>;
|
|
356
|
+
getMany(ids: string[], { connection }?: CallOptions): Promise<StoredRecord[]>;
|
|
357
|
+
getMetadata(id: string, { connection }?: CallOptions): Promise<StoredRecordMetadata | null>;
|
|
358
|
+
getStream(id: string, opts: StreamOptions): Promise<AsyncIterable<Buffer> | null>;
|
|
359
|
+
delete(id: string, { connection }?: CallOptions): Promise<boolean>;
|
|
360
|
+
deleteMany(ids: string[], { connection }?: CallOptions): Promise<string[]>;
|
|
361
|
+
exists(id: string, { connection }?: CallOptions): Promise<boolean>;
|
|
362
|
+
/** Storage statistics, or null if the tables do not exist yet (nothing is created). */
|
|
363
|
+
getInfo(): Promise<StorageInfo | null>;
|
|
364
|
+
/** Ids matching the filters: oldest first, or a random sample. Used by the CLI's verify and tier. */
|
|
365
|
+
listImages(o?: ImageListOptions): Promise<ImageListEntry[]>;
|
|
366
|
+
/**
|
|
367
|
+
* Lock the ref row, delete it, then decrement its blob (the UPDATE takes the blob row lock, so two
|
|
368
|
+
* deletes of different refs to one blob serialize instead of racing) and remove the blob once nothing
|
|
369
|
+
* references it. All in one transaction: a failure can never leave a ref without its count or the reverse.
|
|
370
|
+
*/
|
|
371
|
+
private deleteDedup;
|
|
372
|
+
private deleteManyDedup;
|
|
373
|
+
private hydrate;
|
|
374
|
+
/**
|
|
375
|
+
* Remove tiered objects AFTER their rows are gone: once the row is deleted the image is correctly
|
|
376
|
+
* "not found" to everyone, so a failed object delete only leaves a harmless orphan, whereas deleting
|
|
377
|
+
* the object first and then failing the row delete would leave a row pointing at nothing.
|
|
378
|
+
*
|
|
379
|
+
* Never runs inside a caller-owned transaction (`connection`): we cannot know whether it will
|
|
380
|
+
* commit. In that case the object stays until you remove it yourself after committing. Failures are
|
|
381
|
+
* reported through onOperation and never fail the delete itself.
|
|
382
|
+
*/
|
|
383
|
+
private cleanupObject;
|
|
384
|
+
/**
|
|
385
|
+
* Move an image's bytes out of the database into object storage, replacing the row's `data` with a
|
|
386
|
+
* pointer. Returns null (no such image), false (already tiered: a safe no-op, so backfills can be
|
|
387
|
+
* re-run) or true (tiered just now).
|
|
388
|
+
*
|
|
389
|
+
* SAFETY: the upload happens INSIDE the same transaction as the row lock (SELECT ... FOR UPDATE)
|
|
390
|
+
* and the UPDATE that flips the row. If the upload fails the transaction rolls back and the row is
|
|
391
|
+
* untouched: there is no moment when the bytes exist nowhere, or when a row claims to be tiered
|
|
392
|
+
* without a completed upload.
|
|
393
|
+
*
|
|
394
|
+
* TRADEOFF: InnoDB row-locks only THIS row for the duration of the upload. Concurrent writes to this
|
|
395
|
+
* image wait (up to innodb_lock_wait_timeout, 50s by default); every other row is unaffected and
|
|
396
|
+
* plain reads are never blocked. Meant for explicit maintenance, not hot paths.
|
|
397
|
+
*
|
|
398
|
+
* Retry is safe: a transient error replays the whole closure, and the deterministic key (the image
|
|
399
|
+
* id) makes the re-upload an idempotent overwrite.
|
|
400
|
+
*/
|
|
401
|
+
tierToObjectStorage(id: string, { connection }?: CallOptions): Promise<boolean | null>;
|
|
402
|
+
}
|
|
403
|
+
|
|
278
404
|
declare const SUPPORTED_FORMATS: readonly string[];
|
|
279
405
|
/** Reject images that would decode to more pixels than this, regardless of compressed size (~89 MP). */
|
|
280
406
|
declare const DEFAULT_MAX_PIXELS = 89000000;
|
|
@@ -308,4 +434,4 @@ declare class PDFValidator implements ContentValidator {
|
|
|
308
434
|
}): ValidatedContent;
|
|
309
435
|
}
|
|
310
436
|
|
|
311
|
-
export { AccessDeniedError, CallOptions, ContentValidationError, ContentValidator, CorruptedImageError, DEFAULT_MAX_PIXELS, DEFAULT_STREAM_CHUNK_SIZE, ImageNotFoundError, ImageTooLargeError, ImageValidationError, ObjectStorageLike, OperationEvent, PDFValidator, PostgresBackend, type PostgresBackendOptions, PreparedRow, SQLiteBackend, type SQLiteBackendOptions, SUPPORTED_FORMATS, StorageBackend, StorageError, StoredRecord, StoredRecordMetadata, UnsupportedFormatError, ValidatedContent, type ValidatedImage, ZeroBucketError, validateImage };
|
|
437
|
+
export { AccessDeniedError, CallOptions, ContentValidationError, ContentValidator, CorruptedImageError, DEFAULT_MAX_PIXELS, DEFAULT_STREAM_CHUNK_SIZE, ImageNotFoundError, ImageTooLargeError, ImageValidationError, MySQLBackend, type MySQLBackendOptions, MysqlPoolLike, ObjectStorageLike, OperationEvent, PDFValidator, PostgresBackend, type PostgresBackendOptions, PreparedRow, SQLiteBackend, type SQLiteBackendOptions, SUPPORTED_FORMATS, StorageBackend, StorageError, StoredRecord, StoredRecordMetadata, UnsupportedFormatError, ValidatedContent, type ValidatedImage, ZeroBucketError, validateImage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StorageBackend, O as OperationEvent, a as ObjectStorageLike, P as PreparedRow, C as CallOptions, b as StoredRecord, c as StoredRecordMetadata, d as StreamOptions, e as StorageInfo, I as ImageListOptions, f as ImageListEntry, g as ContentValidator, V as ValidatedContent } from './client-
|
|
2
|
-
export { B as BatchDeleteResult, h as BatchGetResult, i as BatchPutResult, j as BeforeGetHook, k as BeforePutHook, l as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, m as Image, n as ImageInput, o as ImageMetadata, p as
|
|
1
|
+
import { S as StorageBackend, O as OperationEvent, a as ObjectStorageLike, P as PreparedRow, C as CallOptions, b as StoredRecord, c as StoredRecordMetadata, d as StreamOptions, e as StorageInfo, I as ImageListOptions, f as ImageListEntry, M as MysqlPoolLike, g as ContentValidator, V as ValidatedContent } from './client-XQ22b1l3.js';
|
|
2
|
+
export { B as BatchDeleteResult, h as BatchGetResult, i as BatchPutResult, j as BeforeGetHook, k as BeforePutHook, l as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, m as Image, n as ImageInput, o as ImageMetadata, p as MysqlPoolConnectionLike, q as MysqlQueryable, r as ObjectStorage, s as ObjectStorageOptions, t as OptimizationResult, u as OptimizeOptions, v as PutManyOptions, w as PutOptions, Q as Queryable, x as SqliteDatabaseLike, y as StreamOptions, W as WritableLike, Z as ZeroBucket, z as ZeroBucketOptions, A as optimizeImage, E as readInput } from './client-XQ22b1l3.js';
|
|
3
3
|
import { Pool } from 'pg';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -275,6 +275,132 @@ declare class SQLiteBackend implements StorageBackend {
|
|
|
275
275
|
tierToObjectStorage(id: string, { connection }?: CallOptions): Promise<boolean | null>;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
interface MySQLBackendOptions {
|
|
279
|
+
/** `mysql://user:password@host:3306/database` (`mariadb://` is accepted too). Required unless `pool` is given. */
|
|
280
|
+
connectionString?: string;
|
|
281
|
+
/** Bring your own `mysql2/promise` Pool (not closed by `close()`). Pool sizing options are then ignored. */
|
|
282
|
+
pool?: MysqlPoolLike;
|
|
283
|
+
/** Create the schema on first use. Default true. */
|
|
284
|
+
autoMigrate?: boolean;
|
|
285
|
+
/** Retries for transient errors on pooled calls. Default 3; 0 disables. */
|
|
286
|
+
maxRetries?: number;
|
|
287
|
+
/** Base for exponential backoff with jitter (capped at 2s). Default 100. */
|
|
288
|
+
retryBaseDelayMs?: number;
|
|
289
|
+
/** Accepted for parity with the other backends. mysql2 opens connections on demand, so there is no minimum to hold. */
|
|
290
|
+
poolMinSize?: number;
|
|
291
|
+
/** Maximum simultaneous connections. Default 5. */
|
|
292
|
+
poolMaxSize?: number;
|
|
293
|
+
/** Max wait for a pooled connection (also the TCP connect timeout). Default 10000. */
|
|
294
|
+
poolTimeoutMs?: number;
|
|
295
|
+
onOperation?: (event: OperationEvent) => void;
|
|
296
|
+
/** Enables transparent reads of tiered rows and `tierToObjectStorage()`. */
|
|
297
|
+
objectStorage?: ObjectStorageLike;
|
|
298
|
+
/**
|
|
299
|
+
* Content-addressed storage: identical bytes are stored once and shared by every image that has them
|
|
300
|
+
* (reference counted). Same tables as the Python package's dedup mode. Cannot be combined with
|
|
301
|
+
* `objectStorage` (a blob may be shared by many images).
|
|
302
|
+
*/
|
|
303
|
+
dedup?: boolean;
|
|
304
|
+
}
|
|
305
|
+
declare class MySQLBackend implements StorageBackend {
|
|
306
|
+
private readonly opts;
|
|
307
|
+
private pool;
|
|
308
|
+
private readonly ownsPool;
|
|
309
|
+
private readyPromise;
|
|
310
|
+
private closed;
|
|
311
|
+
private readonly maxRetries;
|
|
312
|
+
private readonly retryBaseDelayMs;
|
|
313
|
+
private readonly poolTimeoutMs;
|
|
314
|
+
private readonly autoMigrate;
|
|
315
|
+
private readonly dedup;
|
|
316
|
+
private readonly sql;
|
|
317
|
+
constructor(opts: MySQLBackendOptions);
|
|
318
|
+
ready(): Promise<void>;
|
|
319
|
+
private init;
|
|
320
|
+
/**
|
|
321
|
+
* Create the schema if missing, under a server-side named lock so concurrent first callers (in this
|
|
322
|
+
* or any other process) run the DDL one at a time. Every step checks before it changes anything, so
|
|
323
|
+
* re-running is a no-op.
|
|
324
|
+
*/
|
|
325
|
+
private migrate;
|
|
326
|
+
/** Dedup tables, created only if missing (same no-needless-DDL rule as the classic table). */
|
|
327
|
+
private migrateDedup;
|
|
328
|
+
close(): Promise<void>;
|
|
329
|
+
private emit;
|
|
330
|
+
/** Wait for a pool slot, but never longer than poolTimeoutMs. */
|
|
331
|
+
private acquire;
|
|
332
|
+
/**
|
|
333
|
+
* Run `work` on a pooled connection. `tx` wraps it in a transaction. Transient failures retry the
|
|
334
|
+
* WHOLE closure on a fresh connection after a full rollback.
|
|
335
|
+
*/
|
|
336
|
+
private runPooled;
|
|
337
|
+
/**
|
|
338
|
+
* Run `work` and return its result, emitting exactly one OperationEvent.
|
|
339
|
+
*
|
|
340
|
+
* connection given -> run once on it; no retry, and no commit/rollback of the caller's transaction.
|
|
341
|
+
* connection absent -> pooled, retried (see runPooled).
|
|
342
|
+
*/
|
|
343
|
+
private run;
|
|
344
|
+
/**
|
|
345
|
+
* Make multi-statement work all-or-nothing on a CALLER-supplied connection.
|
|
346
|
+
*
|
|
347
|
+
* Is a transaction open? SAVEPOINT followed by ROLLBACK TO SAVEPOINT succeeds only inside one (in
|
|
348
|
+
* autocommit mode the savepoint is gone before the next statement and the rollback fails with 1305).
|
|
349
|
+
* - Open -> reuse that SAVEPOINT: a failure undoes only our work; success joins the caller's transaction.
|
|
350
|
+
* - None -> START TRANSACTION and COMMIT our own, so a failure can never leave half-applied state.
|
|
351
|
+
*/
|
|
352
|
+
private atomic;
|
|
353
|
+
put(row: PreparedRow, { connection }?: CallOptions): Promise<string>;
|
|
354
|
+
putMany(rows: PreparedRow[], { connection }?: CallOptions): Promise<string[]>;
|
|
355
|
+
get(id: string, { connection }?: CallOptions): Promise<StoredRecord | null>;
|
|
356
|
+
getMany(ids: string[], { connection }?: CallOptions): Promise<StoredRecord[]>;
|
|
357
|
+
getMetadata(id: string, { connection }?: CallOptions): Promise<StoredRecordMetadata | null>;
|
|
358
|
+
getStream(id: string, opts: StreamOptions): Promise<AsyncIterable<Buffer> | null>;
|
|
359
|
+
delete(id: string, { connection }?: CallOptions): Promise<boolean>;
|
|
360
|
+
deleteMany(ids: string[], { connection }?: CallOptions): Promise<string[]>;
|
|
361
|
+
exists(id: string, { connection }?: CallOptions): Promise<boolean>;
|
|
362
|
+
/** Storage statistics, or null if the tables do not exist yet (nothing is created). */
|
|
363
|
+
getInfo(): Promise<StorageInfo | null>;
|
|
364
|
+
/** Ids matching the filters: oldest first, or a random sample. Used by the CLI's verify and tier. */
|
|
365
|
+
listImages(o?: ImageListOptions): Promise<ImageListEntry[]>;
|
|
366
|
+
/**
|
|
367
|
+
* Lock the ref row, delete it, then decrement its blob (the UPDATE takes the blob row lock, so two
|
|
368
|
+
* deletes of different refs to one blob serialize instead of racing) and remove the blob once nothing
|
|
369
|
+
* references it. All in one transaction: a failure can never leave a ref without its count or the reverse.
|
|
370
|
+
*/
|
|
371
|
+
private deleteDedup;
|
|
372
|
+
private deleteManyDedup;
|
|
373
|
+
private hydrate;
|
|
374
|
+
/**
|
|
375
|
+
* Remove tiered objects AFTER their rows are gone: once the row is deleted the image is correctly
|
|
376
|
+
* "not found" to everyone, so a failed object delete only leaves a harmless orphan, whereas deleting
|
|
377
|
+
* the object first and then failing the row delete would leave a row pointing at nothing.
|
|
378
|
+
*
|
|
379
|
+
* Never runs inside a caller-owned transaction (`connection`): we cannot know whether it will
|
|
380
|
+
* commit. In that case the object stays until you remove it yourself after committing. Failures are
|
|
381
|
+
* reported through onOperation and never fail the delete itself.
|
|
382
|
+
*/
|
|
383
|
+
private cleanupObject;
|
|
384
|
+
/**
|
|
385
|
+
* Move an image's bytes out of the database into object storage, replacing the row's `data` with a
|
|
386
|
+
* pointer. Returns null (no such image), false (already tiered: a safe no-op, so backfills can be
|
|
387
|
+
* re-run) or true (tiered just now).
|
|
388
|
+
*
|
|
389
|
+
* SAFETY: the upload happens INSIDE the same transaction as the row lock (SELECT ... FOR UPDATE)
|
|
390
|
+
* and the UPDATE that flips the row. If the upload fails the transaction rolls back and the row is
|
|
391
|
+
* untouched: there is no moment when the bytes exist nowhere, or when a row claims to be tiered
|
|
392
|
+
* without a completed upload.
|
|
393
|
+
*
|
|
394
|
+
* TRADEOFF: InnoDB row-locks only THIS row for the duration of the upload. Concurrent writes to this
|
|
395
|
+
* image wait (up to innodb_lock_wait_timeout, 50s by default); every other row is unaffected and
|
|
396
|
+
* plain reads are never blocked. Meant for explicit maintenance, not hot paths.
|
|
397
|
+
*
|
|
398
|
+
* Retry is safe: a transient error replays the whole closure, and the deterministic key (the image
|
|
399
|
+
* id) makes the re-upload an idempotent overwrite.
|
|
400
|
+
*/
|
|
401
|
+
tierToObjectStorage(id: string, { connection }?: CallOptions): Promise<boolean | null>;
|
|
402
|
+
}
|
|
403
|
+
|
|
278
404
|
declare const SUPPORTED_FORMATS: readonly string[];
|
|
279
405
|
/** Reject images that would decode to more pixels than this, regardless of compressed size (~89 MP). */
|
|
280
406
|
declare const DEFAULT_MAX_PIXELS = 89000000;
|
|
@@ -308,4 +434,4 @@ declare class PDFValidator implements ContentValidator {
|
|
|
308
434
|
}): ValidatedContent;
|
|
309
435
|
}
|
|
310
436
|
|
|
311
|
-
export { AccessDeniedError, CallOptions, ContentValidationError, ContentValidator, CorruptedImageError, DEFAULT_MAX_PIXELS, DEFAULT_STREAM_CHUNK_SIZE, ImageNotFoundError, ImageTooLargeError, ImageValidationError, ObjectStorageLike, OperationEvent, PDFValidator, PostgresBackend, type PostgresBackendOptions, PreparedRow, SQLiteBackend, type SQLiteBackendOptions, SUPPORTED_FORMATS, StorageBackend, StorageError, StoredRecord, StoredRecordMetadata, UnsupportedFormatError, ValidatedContent, type ValidatedImage, ZeroBucketError, validateImage };
|
|
437
|
+
export { AccessDeniedError, CallOptions, ContentValidationError, ContentValidator, CorruptedImageError, DEFAULT_MAX_PIXELS, DEFAULT_STREAM_CHUNK_SIZE, ImageNotFoundError, ImageTooLargeError, ImageValidationError, MySQLBackend, type MySQLBackendOptions, MysqlPoolLike, ObjectStorageLike, OperationEvent, PDFValidator, PostgresBackend, type PostgresBackendOptions, PreparedRow, SQLiteBackend, type SQLiteBackendOptions, SUPPORTED_FORMATS, StorageBackend, StorageError, StoredRecord, StoredRecordMetadata, UnsupportedFormatError, ValidatedContent, type ValidatedImage, ZeroBucketError, validateImage };
|