@picgo/store 1.0.1 → 2.0.0

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.
@@ -4,17 +4,36 @@ export declare enum IDBStatus {
4
4
  started = "started",
5
5
  stopped = "stopped"
6
6
  }
7
+ export interface IFilter {
8
+ orderBy?: 'asc' | 'desc';
9
+ limit?: number;
10
+ offset?: number;
11
+ }
12
+ export interface IGetResult<T> {
13
+ total: number;
14
+ data: Array<IResult<T>>;
15
+ }
7
16
  export interface IObject {
8
17
  id?: string;
9
18
  [propName: string]: any;
10
19
  }
11
20
  export declare type IInsertData = IObject[] | [string, IObject] | [IObject[]];
12
21
  export declare enum IMetaInfoMode {
13
- create = 0,
14
- update = 1
22
+ createMany = 0,
23
+ create = 1,
24
+ update = 2
15
25
  }
16
26
  export declare type IResult<T> = T & {
17
27
  id: string;
18
28
  createdAt: number;
19
29
  updatedAt: number;
20
30
  };
31
+ export interface ILowData {
32
+ [propName: string]: IObject[] | ILowDataKeyMap;
33
+ }
34
+ export interface ILowDataKeyMap {
35
+ [id: string]: 1;
36
+ }
37
+ export interface IJSON {
38
+ [propsName: string]: string | number | IJSON;
39
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@picgo/store",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "scripts": {
8
- "dev": "rm -rf ./dist/* && tsc -w -p .",
9
- "build": "rm -rf ./dist/* && rollup -c",
8
+ "dev": "rimraf ./dist/* && tsc -w -p .",
9
+ "build": "rimraf ./dist/* && rollup -c",
10
10
  "lint": "eslint src/**",
11
11
  "test": "jest --coverage --runInBand",
12
12
  "cz": "git-cz",
@@ -46,8 +46,8 @@
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@picgo/bump-version": "^1.0.3",
48
48
  "@types/jest": "^24.9.0",
49
- "@types/lowdb": "^1.0.9",
50
49
  "@types/node": "^13.1.7",
50
+ "@types/write-file-atomic": "^4.0.0",
51
51
  "@typescript-eslint/eslint-plugin": "2",
52
52
  "commitizen": "^4.2.4",
53
53
  "conventional-changelog": "^3.1.18",
@@ -61,18 +61,24 @@
61
61
  "eslint-plugin-standard": "4",
62
62
  "husky": "^4.0.10",
63
63
  "jest": "^24.9.0",
64
+ "rimraf": "^3.0.2",
64
65
  "rollup": "^1.29.0",
66
+ "rollup-plugin-node-resolve": "^5.2.0",
65
67
  "rollup-plugin-terser": "^5.2.0",
66
68
  "rollup-plugin-typescript2": "^0.25.3",
67
69
  "ts-jest": "^24.3.0",
68
70
  "typescript": "^3.7.4"
69
71
  },
70
72
  "dependencies": {
73
+ "@commonify/lowdb": "^3.0.0",
74
+ "@commonify/steno": "^2.1.0",
71
75
  "@types/bson": "^4.0.1",
72
76
  "@types/graceful-fs": "^4.1.3",
73
- "bson": "^4.0.3",
77
+ "@types/lodash": "^4.14.182",
74
78
  "comment-json": "^4.1.0",
79
+ "fflate": "^0.7.3",
80
+ "lodash": "^4.17.21",
75
81
  "lodash-id": "^0.14.0",
76
- "lowdb": "^1.0.0"
82
+ "write-file-atomic": "^4.0.1"
77
83
  }
78
84
  }
package/rollup.config.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { terser } from 'rollup-plugin-terser'
2
2
  import typescript from 'rollup-plugin-typescript2'
3
+ // import resolve from 'rollup-plugin-node-resolve'
3
4
  export default {
4
5
  input: './src/index.ts',
5
6
  plugins: [
@@ -23,8 +24,11 @@ export default {
23
24
  sourcemap: true
24
25
  }],
25
26
  external: [
26
- 'lowdb',
27
- 'lowdb/adapters/FileSync',
28
- 'bson'
27
+ 'write-file-atomic',
28
+ // '@commonify/steno',
29
+ '@commonify/lowdb',
30
+ 'fflate',
31
+ 'util',
32
+ 'fs'
29
33
  ]
30
34
  }