@tblabs/storage 2.0.0 → 2.0.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
@@ -1,6 +1,7 @@
1
1
  import { OnlineStorage } from "./OnlineStorage";
2
2
  import { IConverter } from "./IConverter";
3
- export declare class Dataset<T extends object> {
3
+ import { IRepo } from "./IRepo";
4
+ export declare class Dataset<T extends object> implements IRepo<T> {
4
5
  private _db;
5
6
  private _converter;
6
7
  private folder;
package/IRepo.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  export interface IRepo<T> {
2
- Ping(): Promise<boolean>;
3
- Add(folder: string, id: string, item: T): Promise<void>;
4
- GetAll(folder: string): Promise<T[]>;
5
- GetOne(folder: string, id: string): Promise<T | null>;
2
+ Add(id: string, item: T): Promise<void>;
3
+ GetAll(): Promise<T[]>;
4
+ GetOne(id: string): Promise<T | null>;
6
5
  FindOne(id: string): Promise<T | null>;
7
- GetAllIds(folder: string): Promise<string[]>;
8
- Update(folder: string, id: string, item: T): Promise<void>;
9
- Delete(folder: string, id: string): Promise<void>;
10
- Move(id: string, sourceFolder: string, targetFolder: string): Promise<void>;
6
+ GetAllIds(): Promise<string[]>;
7
+ Update(id: string, item: T): Promise<void>;
8
+ Delete(id: string): Promise<void>;
9
+ Move(id: string, target: IRepo<any>): Promise<void>;
11
10
  Drop(): Promise<void>;
12
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tblabs/storage",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "online storage module",
5
5
  "license": "beerware",
6
6
  "main": "index.js",
@@ -9,7 +9,7 @@
9
9
  "pack": "cd ./bin && npm pack",
10
10
  "clean": "rm ./bin -rf && rm *.tgz -rf",
11
11
  "build": "npm run clean && tsc ./src/index.ts --declaration --outDir ./bin && cp ./package.json ./bin/package.json",
12
- "publish:npm": "npm login && npm run build && npm run pack && cd ./bin && npm publish --access public"
12
+ "publish:npm": "npm run build &&npm login && npm run pack && cd ./bin && npm publish --access public"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/jest": "^30.0.0",
Binary file
Binary file