harperdb 4.6.11 → 4.6.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harperdb",
3
- "version": "4.6.11",
3
+ "version": "4.6.13",
4
4
  "description": "HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.",
5
5
  "keywords": [
6
6
  "database",
@@ -43,12 +43,12 @@ type ResidencyDefinition = number | string[] | void;
43
43
  */
44
44
  export declare function makeTable(options: any): {
45
45
  new (identifier: Id, source: any): {
46
- #record: any;
47
- #changes: any;
48
- #version?: number;
49
- #entry?: Entry;
50
- #saveMode?: boolean;
51
- #loadedFromSource?: boolean;
46
+ "__#private@#record": any;
47
+ "__#private@#changes": any;
48
+ "__#private@#version"?: number;
49
+ "__#private@#entry"?: Entry;
50
+ "__#private@#saveMode"?: boolean;
51
+ "__#private@#loadedFromSource"?: boolean;
52
52
  getProperty: (name: string) => any;
53
53
  /**
54
54
  * This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
@@ -98,8 +98,8 @@ export declare function makeTable(options: any): {
98
98
  getExpiresAt(): number;
99
99
  addTo(property: string, value: number | bigint): void;
100
100
  subtractFrom(property: string, value: number | bigint): void;
101
- #record: any;
102
- #changes: any;
101
+ "__#private@#record": any;
102
+ "__#private@#changes": any;
103
103
  getRecord(): any;
104
104
  setRecord(record: any): void;
105
105
  getChanges(): any;
@@ -196,9 +196,9 @@ export declare function makeTable(options: any): {
196
196
  validate(record: any, patch?: boolean): void;
197
197
  getUpdatedTime(): number;
198
198
  wasLoadedFromSource(): boolean | void;
199
- readonly #id: Id;
200
- readonly #context: Context;
201
- #isCollection: boolean;
199
+ readonly "__#private@#id": Id;
200
+ readonly "__#private@#context": Context;
201
+ "__#private@#isCollection": boolean;
202
202
  post(newRecord: any): Promise<any>;
203
203
  get isCollection(): boolean;
204
204
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
@@ -252,12 +252,12 @@ export declare function makeTable(options: any): {
252
252
  * @returns
253
253
  */
254
254
  getResource(id: Id, request: Context, resourceOptions?: any): Promise<{
255
- #record: any;
256
- #changes: any;
257
- #version?: number;
258
- #entry?: Entry;
259
- #saveMode?: boolean;
260
- #loadedFromSource?: boolean;
255
+ "__#private@#record": any;
256
+ "__#private@#changes": any;
257
+ "__#private@#version"?: number;
258
+ "__#private@#entry"?: Entry;
259
+ "__#private@#saveMode"?: boolean;
260
+ "__#private@#loadedFromSource"?: boolean;
261
261
  getProperty: (name: string) => any;
262
262
  /**
263
263
  * This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
@@ -307,8 +307,8 @@ export declare function makeTable(options: any): {
307
307
  getExpiresAt(): number;
308
308
  addTo(property: string, value: number | bigint): void;
309
309
  subtractFrom(property: string, value: number | bigint): void;
310
- #record: any;
311
- #changes: any;
310
+ "__#private@#record": any;
311
+ "__#private@#changes": any;
312
312
  getRecord(): any;
313
313
  setRecord(record: any): void;
314
314
  getChanges(): any;
@@ -405,21 +405,21 @@ export declare function makeTable(options: any): {
405
405
  validate(record: any, patch?: boolean): void;
406
406
  getUpdatedTime(): number;
407
407
  wasLoadedFromSource(): boolean | void;
408
- readonly #id: Id;
409
- readonly #context: Context;
410
- #isCollection: boolean;
408
+ readonly "__#private@#id": Id;
409
+ readonly "__#private@#context": Context;
410
+ "__#private@#isCollection": boolean;
411
411
  post(newRecord: any): Promise<any>;
412
412
  get isCollection(): boolean;
413
413
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
414
414
  getId(): Id;
415
415
  getContext(): Context;
416
416
  }> | {
417
- #record: any;
418
- #changes: any;
419
- #version?: number;
420
- #entry?: Entry;
421
- #saveMode?: boolean;
422
- #loadedFromSource?: boolean;
417
+ "__#private@#record": any;
418
+ "__#private@#changes": any;
419
+ "__#private@#version"?: number;
420
+ "__#private@#entry"?: Entry;
421
+ "__#private@#saveMode"?: boolean;
422
+ "__#private@#loadedFromSource"?: boolean;
423
423
  getProperty: (name: string) => any;
424
424
  /**
425
425
  * This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
@@ -469,8 +469,8 @@ export declare function makeTable(options: any): {
469
469
  getExpiresAt(): number;
470
470
  addTo(property: string, value: number | bigint): void;
471
471
  subtractFrom(property: string, value: number | bigint): void;
472
- #record: any;
473
- #changes: any;
472
+ "__#private@#record": any;
473
+ "__#private@#changes": any;
474
474
  getRecord(): any;
475
475
  setRecord(record: any): void;
476
476
  getChanges(): any;
@@ -567,9 +567,9 @@ export declare function makeTable(options: any): {
567
567
  validate(record: any, patch?: boolean): void;
568
568
  getUpdatedTime(): number;
569
569
  wasLoadedFromSource(): boolean | void;
570
- readonly #id: Id;
571
- readonly #context: Context;
572
- #isCollection: boolean;
570
+ readonly "__#private@#id": Id;
571
+ readonly "__#private@#context": Context;
572
+ "__#private@#isCollection": boolean;
573
573
  post(newRecord: any): Promise<any>;
574
574
  get isCollection(): boolean;
575
575
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
@@ -613,7 +613,7 @@ export declare function makeTable(options: any): {
613
613
  /**
614
614
  * Evicting a record will remove it from a caching table. This is not considered a canonical data change, and it is assumed that retrieving this record from the source will still yield the same record, this is only removing the local copy of the record.
615
615
  */
616
- evict(id: any, existingRecord: any, existingVersion: any): Promise<void>;
616
+ evict(id: any, existingRecord: any, existingVersion: any): any;
617
617
  operation(operation: any, context: any): any;
618
618
  /**
619
619
  * This is responsible for ordering and select()ing the attributes/properties from returned entries
@@ -11,6 +11,7 @@
11
11
  * - Note that for compressed data, the size is the uncompressed size, and the compressed size in the file
12
12
  */
13
13
  import type { LMDBStore } from 'lmdb';
14
+ import * as buffer from 'node:buffer';
14
15
  type StorageInfo = {
15
16
  storageIndex: number;
16
17
  fileId: string;
@@ -26,6 +27,7 @@ type StorageInfo = {
26
27
  end?: number;
27
28
  saving?: Promise<void>;
28
29
  asString?: string;
30
+ deleteOnFailure?: boolean;
29
31
  };
30
32
  export declare const Blob: {
31
33
  new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
@@ -38,7 +40,7 @@ export declare const Blob: {
38
40
  arrayBuffer(): Promise<ArrayBufferLike>;
39
41
  get size(): number;
40
42
  slice(): /*elided*/ any;
41
- bytes(): Promise<Buffer>;
43
+ bytes(): Promise<buffer.Buffer>;
42
44
  get type(): string;
43
45
  };
44
46
  };
@@ -52,7 +54,7 @@ declare namespace InstanceOfBlobWithNoConstructor {
52
54
  arrayBuffer(): Promise<ArrayBufferLike>;
53
55
  get size(): number;
54
56
  slice(): /*elided*/ any;
55
- bytes(): Promise<Buffer>;
57
+ bytes(): Promise<buffer.Buffer>;
56
58
  get type(): string;
57
59
  };
58
60
  }
@@ -81,6 +83,7 @@ declare class FileBackedBlob extends InstanceOfBlobWithNoConstructor {
81
83
  stream(): ReadableStream;
82
84
  slice(start: number, end: number, type?: string): Blob;
83
85
  save(): Promise<void>;
86
+ get written(): Promise<void>;
84
87
  }
85
88
  /**
86
89
  * Delete the file for the blob
@@ -95,7 +98,7 @@ export type BlobCreationOptions = {
95
98
  size?: number;
96
99
  saveBeforeCommit?: boolean;
97
100
  };
98
- export declare function saveBlob(blob: FileBackedBlob): StorageInfo;
101
+ export declare function saveBlob(blob: FileBackedBlob, deleteOnFailure?: boolean): StorageInfo;
99
102
  export declare function getFileId(blob: Blob): string;
100
103
  export declare function isSaving(blob: Blob): string;
101
104
  export declare function getFilePathForBlob(blob: FileBackedBlob): string;