@tblabs/storage 5.9.0 → 5.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/Dataset.d.ts CHANGED
@@ -13,7 +13,7 @@ export declare class Dataset<T extends object> implements IRepo<T> {
13
13
  private get DatasetPath();
14
14
  CanUserDo(action: keyof IStorageUserPrivileges): boolean;
15
15
  GetOne(id: string): Promise<T>;
16
- Read(id: string, length?: number, offset?: number): Promise<string>;
16
+ Read(id: string, offset?: number, limit?: number): Promise<string>;
17
17
  GetAll(): Promise<T[]>;
18
18
  GetAllIds(): Promise<string[]>;
19
19
  Add(id: string, item: T): Promise<void>;
package/Dataset.js CHANGED
@@ -48,9 +48,9 @@ export class Dataset {
48
48
  this._db.Log(`Fetched "${id}" from "${this.DatasetPath}".`);
49
49
  return item;
50
50
  }
51
- async Read(id, length = 0, offset = 0) {
51
+ async Read(id, offset = 0, limit = 0) {
52
52
  this._db.Log(`Reading "${id}" from "${this.DatasetPath}"...`);
53
- const queryResult = await this._db.Send(new ReadFileQuery(this._db.DatabaseDir, this.dataset, id, length, offset));
53
+ const queryResult = await this._db.Send(new ReadFileQuery(this._db.DatabaseDir, this.dataset, id, offset, limit));
54
54
  if (!queryResult.IsSuccess) {
55
55
  throw new Error("Failed to read: " + queryResult.ErrorMessage);
56
56
  }
@@ -1,5 +1,5 @@
1
1
  import { Message } from '../MessageBus/Message';
2
2
  import { dir } from '../Types/dir';
3
3
  export declare class ReadFileQuery extends Message {
4
- constructor(Database: dir, Dataset: dir, FileId: string, Length?: number, Offset?: number);
4
+ constructor(Database: dir, Dataset: dir, FileId: string, Offset?: number, Limit?: number);
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { Message } from '../MessageBus/Message';
2
2
  export class ReadFileQuery extends Message {
3
- constructor(Database, Dataset, FileId, Length = 0, Offset = 0) {
4
- super("ReadFile", { Database, Dataset, FileId, Length, Offset });
3
+ constructor(Database, Dataset, FileId, Offset = 0, Limit = 0) {
4
+ super("ReadFile", { Database, Dataset, FileId, Offset, Limit });
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tblabs/storage",
3
- "version": "5.9.0",
3
+ "version": "5.9.1",
4
4
  "description": "online storage module with auth",
5
5
  "license": "beerware",
6
6
  "main": "index.js",
Binary file
Binary file