@qrvey/data-persistence 0.0.2-4-rev-1 → 0.0.2-4-rev-2
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/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +15 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +18 -1
- package/package.json +19 -5
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAiE;AAAxD,4HAAA,OAAO,OAAe;AAC/B,mDAAkD;AAAzC,wGAAA,UAAU,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAiE;AAAxD,4HAAA,OAAO,OAAe;AAC/B,mDAAkD;AAAzC,wGAAA,UAAU,OAAA;AAWnB,qDAAgF;AAAvE,0GAAA,WAAW,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,wGAAA,SAAS,OAAA"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { default as default2 } from "./services/crud.service";
|
|
2
2
|
import { CrudSchema } from "./schemas/crudSchema";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
IFindOptions,
|
|
5
|
+
ISorting,
|
|
6
|
+
ICrudService,
|
|
7
|
+
IFilter,
|
|
8
|
+
IFindPagination
|
|
9
|
+
} from "./interfaces";
|
|
10
|
+
import { SortDirection, AggregateFunction, FilterInput } from "./types";
|
|
4
11
|
import { buildFilter, buildQueryIndex, buildSort } from "./helpers/crudHelpers";
|
|
5
12
|
export {
|
|
13
|
+
AggregateFunction,
|
|
6
14
|
CrudSchema,
|
|
7
15
|
default2 as CrudService,
|
|
16
|
+
FilterInput,
|
|
17
|
+
ICrudService,
|
|
18
|
+
IFilter,
|
|
8
19
|
IFindOptions,
|
|
20
|
+
IFindPagination,
|
|
21
|
+
ISorting,
|
|
22
|
+
SortDirection,
|
|
9
23
|
buildFilter,
|
|
10
24
|
buildQueryIndex,
|
|
11
25
|
buildSort
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { default as CrudService } from './services/crud.service';\nexport { CrudSchema } from './schemas/crudSchema';\nexport {
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { default as CrudService } from './services/crud.service';\nexport { CrudSchema } from './schemas/crudSchema';\nexport {\n IFindOptions,\n ISorting,\n ICrudService,\n IFilter,\n IFindPagination,\n} from './interfaces';\n\nexport { SortDirection, AggregateFunction, FilterInput } from './types';\n\nexport { buildFilter, buildQueryIndex, buildSort } from './helpers/crudHelpers';\n"],"mappings":"AAAA,SAAoB,WAAXA,gBAA8B;AACvC,SAAS,kBAAkB;AAC3B;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,SAAS,eAAe,mBAAmB,mBAAmB;AAE9D,SAAS,aAAa,iBAAiB,iBAAiB;","names":["default"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -38,6 +38,21 @@ interface IFindResult<T> {
|
|
|
38
38
|
count: number;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
interface IUpdateOptions {
|
|
42
|
+
replace?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface ICrudService<T> {
|
|
46
|
+
create(entity: T): Promise<T>;
|
|
47
|
+
findItem(options?: IFindOptions): Promise<T | null>;
|
|
48
|
+
find(options?: IFindOptions): Promise<IFindResult<T>>;
|
|
49
|
+
findAll(options?: IFindOptions): Promise<IFindResult<T>>;
|
|
50
|
+
findCount(options?: IFindOptions): Promise<number>;
|
|
51
|
+
update(filters: IFilter[] | ICompoundFilter, data: Partial<T>, options?: IUpdateOptions): Promise<any | null>;
|
|
52
|
+
remove(filters: IFilter[] | ICompoundFilter): Promise<void>;
|
|
53
|
+
runQuery(queryCommand: any): Promise<any>;
|
|
54
|
+
}
|
|
55
|
+
|
|
41
56
|
declare enum SORT_DIRECTIONS {
|
|
42
57
|
ASC = "ASC",
|
|
43
58
|
DESC = "DESC"
|
|
@@ -66,6 +81,8 @@ interface ITableColumns {
|
|
|
66
81
|
};
|
|
67
82
|
}
|
|
68
83
|
|
|
84
|
+
type FilterInput = string | IFilter[] | ICompoundFilter[] | ICompoundFilter;
|
|
85
|
+
|
|
69
86
|
declare const VALID_FILTER_LOGIC_OPERATORS: FILTER_LOGIC_OPERATORS[];
|
|
70
87
|
type FilterLogicOperator = (typeof VALID_FILTER_LOGIC_OPERATORS)[number];
|
|
71
88
|
|
|
@@ -121,4 +138,4 @@ declare function buildQueryIndex(indexName: string, columns: string[]): {
|
|
|
121
138
|
};
|
|
122
139
|
declare function buildSort(column: string, direction?: SortDirection): ISorting;
|
|
123
140
|
|
|
124
|
-
export { CrudSchema, CrudService, IFindOptions, buildFilter, buildQueryIndex, buildSort };
|
|
141
|
+
export { AggregateFunction, CrudSchema, CrudService, FilterInput, ICrudService, IFilter, IFindOptions, IFindPagination, ISorting, SortDirection, buildFilter, buildQueryIndex, buildSort };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@qrvey/data-persistence",
|
|
3
3
|
"types": "dist/types/index.d.ts",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
|
-
"version": "0.0.2-4-rev-
|
|
5
|
+
"version": "0.0.2-4-rev-2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
@@ -30,10 +30,24 @@
|
|
|
30
30
|
"publish-package": "yarn prepare-publish && npm publish"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@aws-sdk/client-dynamodb": "
|
|
34
|
-
"@aws-sdk/lib-dynamodb": "
|
|
35
|
-
"pg": "
|
|
36
|
-
"pg-format": "
|
|
33
|
+
"@aws-sdk/client-dynamodb": "3.x",
|
|
34
|
+
"@aws-sdk/lib-dynamodb": "3.x",
|
|
35
|
+
"pg": "8.11.4",
|
|
36
|
+
"pg-format": "1.0.4"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"@aws-sdk/client-dynamodb": {
|
|
40
|
+
"optional": true
|
|
41
|
+
},
|
|
42
|
+
"@aws-sdk/lib-dynamodb": {
|
|
43
|
+
"optional": true
|
|
44
|
+
},
|
|
45
|
+
"pg": {
|
|
46
|
+
"optional": true
|
|
47
|
+
},
|
|
48
|
+
"pg-format": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
37
51
|
},
|
|
38
52
|
"devDependencies": {
|
|
39
53
|
"@types/jest": "^29.5.5",
|