zerobucket 0.8.2 → 0.9.1
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 +53 -29
- package/dist/{client-l4jPIFJI.d.cts → client-7ZNu3xMJ.d.cts} +3 -1
- package/dist/{client-l4jPIFJI.d.ts → client-7ZNu3xMJ.d.ts} +3 -1
- package/dist/http.d.cts +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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, M as MigrateToDedupOptions, g as MigrateToDedupResult, h as MysqlPoolLike, i as ContentValidator, V as ValidatedContent } from './client-
|
|
2
|
-
export { B as BatchDeleteResult, j as BatchGetResult, k as BatchPutResult, l as BeforeGetHook, m as BeforePutHook, n as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, o as Image, p as ImageInput, q as ImageMetadata, r as MysqlPoolConnectionLike, s as MysqlQueryable, t as ObjectStorage, u as ObjectStorageOptions, v as OptimizationResult, w as OptimizeOptions, x as PutManyOptions, y as PutOptions, Q as Queryable, z as SqliteDatabaseLike, A as StreamOptions, W as WritableLike, Z as ZeroBucket, E as ZeroBucketOptions, F as optimizeImage, H as readInput } from './client-
|
|
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 MigrateToDedupOptions, g as MigrateToDedupResult, h as MysqlPoolLike, i as ContentValidator, V as ValidatedContent } from './client-7ZNu3xMJ.cjs';
|
|
2
|
+
export { B as BatchDeleteResult, j as BatchGetResult, k as BatchPutResult, l as BeforeGetHook, m as BeforePutHook, n as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, o as Image, p as ImageInput, q as ImageMetadata, r as MysqlPoolConnectionLike, s as MysqlQueryable, t as ObjectStorage, u as ObjectStorageOptions, v as OptimizationResult, w as OptimizeOptions, x as PutManyOptions, y as PutOptions, Q as Queryable, z as SqliteDatabaseLike, A as StreamOptions, W as WritableLike, Z as ZeroBucket, E as ZeroBucketOptions, F as optimizeImage, H as readInput } from './client-7ZNu3xMJ.cjs';
|
|
3
3
|
import { Pool } from 'pg';
|
|
4
4
|
|
|
5
5
|
/**
|
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, M as MigrateToDedupOptions, g as MigrateToDedupResult, h as MysqlPoolLike, i as ContentValidator, V as ValidatedContent } from './client-
|
|
2
|
-
export { B as BatchDeleteResult, j as BatchGetResult, k as BatchPutResult, l as BeforeGetHook, m as BeforePutHook, n as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, o as Image, p as ImageInput, q as ImageMetadata, r as MysqlPoolConnectionLike, s as MysqlQueryable, t as ObjectStorage, u as ObjectStorageOptions, v as OptimizationResult, w as OptimizeOptions, x as PutManyOptions, y as PutOptions, Q as Queryable, z as SqliteDatabaseLike, A as StreamOptions, W as WritableLike, Z as ZeroBucket, E as ZeroBucketOptions, F as optimizeImage, H as readInput } from './client-
|
|
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 MigrateToDedupOptions, g as MigrateToDedupResult, h as MysqlPoolLike, i as ContentValidator, V as ValidatedContent } from './client-7ZNu3xMJ.js';
|
|
2
|
+
export { B as BatchDeleteResult, j as BatchGetResult, k as BatchPutResult, l as BeforeGetHook, m as BeforePutHook, n as Connection, D as DEFAULT_MAX_BYTES, G as GetOptions, o as Image, p as ImageInput, q as ImageMetadata, r as MysqlPoolConnectionLike, s as MysqlQueryable, t as ObjectStorage, u as ObjectStorageOptions, v as OptimizationResult, w as OptimizeOptions, x as PutManyOptions, y as PutOptions, Q as Queryable, z as SqliteDatabaseLike, A as StreamOptions, W as WritableLike, Z as ZeroBucket, E as ZeroBucketOptions, F as optimizeImage, H as readInput } from './client-7ZNu3xMJ.js';
|
|
3
3
|
import { Pool } from 'pg';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -3302,6 +3302,7 @@ var ZeroBucket = class _ZeroBucket {
|
|
|
3302
3302
|
}
|
|
3303
3303
|
// ---- hooks -----------------------------------------------------------
|
|
3304
3304
|
async checkBeforeGet(imageId, context) {
|
|
3305
|
+
if (!isValidId(imageId)) throw new ImageNotFoundError(imageId);
|
|
3305
3306
|
if (!this.beforeGet) return;
|
|
3306
3307
|
if (!await this.beforeGet(imageId, context))
|
|
3307
3308
|
throw new AccessDeniedError("get", imageId);
|
|
@@ -3465,6 +3466,10 @@ var ZeroBucket = class _ZeroBucket {
|
|
|
3465
3466
|
const allowedIdx = [];
|
|
3466
3467
|
for (let i = 0; i < imageIds.length; i++) {
|
|
3467
3468
|
const imageId = imageIds[i];
|
|
3469
|
+
if (!isValidId(imageId)) {
|
|
3470
|
+
results[i] = { imageId, image: null, error: "not found", success: false };
|
|
3471
|
+
continue;
|
|
3472
|
+
}
|
|
3468
3473
|
if (this.beforeGet) {
|
|
3469
3474
|
try {
|
|
3470
3475
|
if (!await this.beforeGet(imageId, options.context)) {
|