@hozon/store-blob 0.2.0 → 0.2.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/lib/api.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { chunk, withStoreTransaction } from '@hozon/db';
2
2
  import { b64uFromUTF, b64uToUTF } from '@sozai/codec';
3
+ import { InvalidCursorError } from './errors.js';
3
4
  function encodeCursor(createdAt, blobID) {
4
5
  return b64uFromUTF(JSON.stringify([
5
6
  createdAt,
@@ -18,7 +19,7 @@ function decodeCursor(cursor) {
18
19
  } catch {
19
20
  // fall through
20
21
  }
21
- throw new Error('Invalid cursor');
22
+ throw new InvalidCursorError();
22
23
  }
23
24
  export function createBlobStoreAPI(db, adapter) {
24
25
  async function insertManifest(trx, blobID, chunks) {
@@ -0,0 +1,3 @@
1
+ export declare class InvalidCursorError extends Error {
2
+ constructor(options?: ErrorOptions);
3
+ }
package/lib/errors.js ADDED
@@ -0,0 +1,6 @@
1
+ export class InvalidCursorError extends Error {
2
+ constructor(options){
3
+ super('Invalid cursor', options);
4
+ this.name = 'InvalidCursorError';
5
+ }
6
+ }
package/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { BLOB_STORE, blobStoreDefinition, getBlobStore } from './definition.js';
2
+ export { InvalidCursorError } from './errors.js';
2
3
  export type { BlobChunkTable, BlobEntryTable, BlobTables, BlobTransferSessionTable, BlobTransferTable, } from './tables.js';
3
4
  export type { BeginTransferParams, BlobChunkInput, BlobEntry, BlobEntryInput, BlobState, BlobStoreAPI, BlobTransfer, } from './types.js';
package/lib/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { BLOB_STORE, blobStoreDefinition, getBlobStore } from './definition.js';
2
+ export { InvalidCursorError } from './errors.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hozon/store-blob",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Content-addressed blob metadata and resumable transfer store for Hozon",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,14 +18,14 @@
18
18
  ],
19
19
  "dependencies": {
20
20
  "@hozon/adapter": "^0.1.0",
21
- "@hozon/db": "^0.2.2",
22
- "@sozai/codec": "^0.4.2"
21
+ "@hozon/db": "^0.2.3",
22
+ "@sozai/codec": "^0.4.3"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@hozon/node-sqlite": "^0.1.0",
26
- "@types/node": "^26.6.4",
27
- "del-cli": "^7.0.0",
28
- "vitest": "5.0.3"
26
+ "@types/node": "^26.6.5",
27
+ "del-cli": "^8.0.1",
28
+ "vitest": "5.0.4"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"