@thisisagile/easy 10.11.6 → 10.11.7
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/process/Search.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Repo, Struct } from '../domain';
|
|
2
2
|
import { Id, JsonValue, Key, PageList, PageOptions } from '../types';
|
|
3
|
+
import { Req } from '../resources';
|
|
3
4
|
export declare class Search<T extends Struct> {
|
|
4
5
|
protected repo: Repo<T>;
|
|
5
6
|
constructor(repo: Repo<T>);
|
|
@@ -7,6 +8,7 @@ export declare class Search<T extends Struct> {
|
|
|
7
8
|
byId: (id: Id) => Promise<T>;
|
|
8
9
|
byIds: (...ids: Id[]) => Promise<PageList<T>>;
|
|
9
10
|
byKey: (key: Key, options?: PageOptions | undefined) => Promise<PageList<T>>;
|
|
11
|
+
query: ({ query, skip, take }: Req) => Promise<PageList<T>>;
|
|
10
12
|
search: (query: JsonValue, options?: PageOptions | undefined) => Promise<PageList<T>>;
|
|
11
13
|
exists: (id: Id) => Promise<boolean>;
|
|
12
14
|
}
|
package/dist/process/Search.js
CHANGED
|
@@ -10,6 +10,7 @@ class Search {
|
|
|
10
10
|
this.byId = (id) => this.repo.byId(id);
|
|
11
11
|
this.byIds = (...ids) => this.repo.byIds(...ids);
|
|
12
12
|
this.byKey = (key, options) => this.repo.byKey(key, options);
|
|
13
|
+
this.query = ({ query, skip, take }) => this.search(query, { skip, take });
|
|
13
14
|
this.search = (query, options) => (0, types_1.choose)(query)
|
|
14
15
|
.case(types_1.isNotEmpty, q => this.repo.search(q, options))
|
|
15
16
|
.else((0, utils_1.resolve)((0, types_1.toList)()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../src/process/Search.ts"],"names":[],"mappings":";;;AACA,oCAAiG;AACjG,oCAAmC;
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../src/process/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
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "10.11.
|
|
3
|
+
"version": "10.11.7",
|
|
4
4
|
"description": "Straightforward library for building domain-driven microservice architectures",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@thisisagile/easy-test": "10.11.
|
|
34
|
+
"@thisisagile/easy-test": "10.11.7",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^8.5.8",
|
|
37
37
|
"@types/validator": "^13.7.2"
|
package/src/process/Search.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Repo, Struct } from '../domain';
|
|
2
2
|
import { choose, Id, isNotEmpty, JsonValue, Key, toList, PageList, PageOptions } from '../types';
|
|
3
3
|
import { resolve } from '../utils';
|
|
4
|
+
import { Req } from '../resources';
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
export class Search<T extends Struct> {
|
|
@@ -14,6 +15,8 @@ export class Search<T extends Struct> {
|
|
|
14
15
|
|
|
15
16
|
byKey = (key: Key,options?: PageOptions): Promise<PageList<T>> => this.repo.byKey(key, options);
|
|
16
17
|
|
|
18
|
+
query = ({query, skip, take}: Req): Promise<PageList<T>> => this.search(query, {skip, take});
|
|
19
|
+
|
|
17
20
|
search = (query: JsonValue, options?: PageOptions): Promise<PageList<T>> =>
|
|
18
21
|
choose(query)
|
|
19
22
|
.case(isNotEmpty, q => this.repo.search(q, options))
|