@thisisagile/easy 12.22.6 → 12.22.10
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/domain/Repo.d.ts +8 -9
- package/dist/domain/Repo.js +1 -2
- package/dist/domain/Repo.js.map +1 -1
- package/dist/domain/Typo.d.ts +8 -9
- package/dist/domain/Typo.js +1 -2
- package/dist/domain/Typo.js.map +1 -1
- package/dist/process/Manage.d.ts +2 -2
- package/dist/process/Manage.js.map +1 -1
- package/dist/process/Search.d.ts +8 -9
- package/dist/process/Search.js.map +1 -1
- package/package.json +2 -2
- package/src/domain/Repo.ts +24 -9
- package/src/domain/Typo.ts +8 -9
- package/src/process/Manage.ts +2 -2
- package/src/process/Search.ts +8 -9
package/dist/domain/Repo.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { Constructor, Gateway, Id, Json, JsonValue, Key, List, PageList,
|
|
1
|
+
import { Constructor, FetchOptions, Gateway, Id, Json, JsonValue, Key, List, PageList, Repository } from '../types';
|
|
2
2
|
import { Struct } from './Struct';
|
|
3
|
-
|
|
4
|
-
export declare class Repo<T extends Struct> extends Repository<T> {
|
|
3
|
+
export declare class Repo<T extends Struct, Options = FetchOptions> extends Repository<T, Options> {
|
|
5
4
|
protected ctor: Constructor<T>;
|
|
6
5
|
private readonly gateway;
|
|
7
|
-
constructor(ctor: Constructor<T>, gateway: Gateway);
|
|
6
|
+
constructor(ctor: Constructor<T>, gateway: Gateway<Options>);
|
|
8
7
|
create: (item: T | Json) => T;
|
|
9
|
-
all(options?:
|
|
8
|
+
all(options?: Options): Promise<PageList<T>>;
|
|
10
9
|
byId(id: Id): Promise<T>;
|
|
11
10
|
byIds(...ids: Id[]): Promise<List<T>>;
|
|
12
|
-
byKey(key: Key, options?:
|
|
13
|
-
by(key: keyof T, value: JsonValue, options?:
|
|
14
|
-
search(q: JsonValue, options?:
|
|
15
|
-
filter(options?:
|
|
11
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>>;
|
|
12
|
+
by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
13
|
+
search(q: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
14
|
+
filter(options?: Options): Promise<PageList<T>>;
|
|
16
15
|
exists(id: Id): Promise<boolean>;
|
|
17
16
|
add(t: T | Json): Promise<T>;
|
|
18
17
|
update(id: Id, json: Json): Promise<T>;
|
package/dist/domain/Repo.js
CHANGED
|
@@ -4,8 +4,7 @@ exports.Repo = void 0;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const validation_1 = require("../validation");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
-
|
|
8
|
-
class Repo extends types_2.Repository {
|
|
7
|
+
class Repo extends types_1.Repository {
|
|
9
8
|
constructor(ctor, gateway) {
|
|
10
9
|
super();
|
|
11
10
|
this.ctor = ctor;
|
package/dist/domain/Repo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Repo.js","sourceRoot":"","sources":["../../src/domain/Repo.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Repo.js","sourceRoot":"","sources":["../../src/domain/Repo.ts"],"names":[],"mappings":";;;AAAA,oCAgBkB;AAClB,8CAAqC;AACrC,oCAA2C;AAG3C,MAAa,IAA+C,SAAQ,kBAAsB;IACxF,YAAsB,IAAoB,EAAmB,OAAyB;QACpF,KAAK,EAAE,CAAC;QADY,SAAI,GAAJ,IAAI,CAAgB;QAAmB,YAAO,GAAP,OAAO,CAAkB;QAItF,WAAM,GAAG,CAAC,IAAc,EAAK,EAAE,CAAC,CAAC,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAFnF,CAAC;IAID,GAAG,CAAC,OAAiB;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,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CAAC,CAAC,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3G,CAAC;CACF;AA7ED,oBA6EC"}
|
package/dist/domain/Typo.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { Gateway, Id, Json, JsonValue, Key, List, PageList,
|
|
1
|
+
import { FetchOptions, Gateway, Id, Json, JsonValue, Key, List, PageList, Repository } from '../types';
|
|
2
2
|
import { View } from '../utils';
|
|
3
|
-
|
|
4
|
-
export declare class Typo<T> extends Repository<T> {
|
|
3
|
+
export declare class Typo<T, Options = FetchOptions> extends Repository<T, Options> {
|
|
5
4
|
protected view: View;
|
|
6
5
|
private readonly gateway;
|
|
7
|
-
constructor(view: View, gateway: Gateway);
|
|
6
|
+
constructor(view: View, gateway: Gateway<Options>);
|
|
8
7
|
create: (j: Json) => T;
|
|
9
|
-
all(options?:
|
|
8
|
+
all(options?: Options): Promise<PageList<T>>;
|
|
10
9
|
byId(id: Id): Promise<T>;
|
|
11
10
|
byIds(...ids: Id[]): Promise<List<T>>;
|
|
12
|
-
byKey(key: Key, options?:
|
|
13
|
-
by(key: keyof T, value: JsonValue, options?:
|
|
14
|
-
search(q: JsonValue, options?:
|
|
15
|
-
filter(options?:
|
|
11
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>>;
|
|
12
|
+
by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
13
|
+
search(q: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
14
|
+
filter(options?: Options): Promise<PageList<T>>;
|
|
16
15
|
exists(id: Id): Promise<boolean>;
|
|
17
16
|
}
|
package/dist/domain/Typo.js
CHANGED
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Typo = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const validation_1 = require("../validation");
|
|
6
|
-
|
|
7
|
-
class Typo extends types_2.Repository {
|
|
6
|
+
class Typo extends types_1.Repository {
|
|
8
7
|
constructor(view, gateway) {
|
|
9
8
|
super();
|
|
10
9
|
this.view = view;
|
package/dist/domain/Typo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typo.js","sourceRoot":"","sources":["../../src/domain/Typo.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Typo.js","sourceRoot":"","sources":["../../src/domain/Typo.ts"],"names":[],"mappings":";;;AAAA,oCAAsI;AACtI,8CAAqC;AAGrC,MAAa,IAAgC,SAAQ,kBAAsB;IACzE,YAAsB,IAAU,EAAmB,OAAyB;QAC1E,KAAK,EAAE,CAAC;QADY,SAAI,GAAJ,IAAI,CAAM;QAAmB,YAAO,GAAP,OAAO,CAAkB;QAI5E,WAAM,GAAG,CAAC,CAAO,EAAK,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAiB,CAAC;IAF3D,CAAC;IAID,GAAG,CAAC,OAAiB;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,kBAAU,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvF,CAAC;IAED,IAAI,CAAC,EAAM;QACT,OAAO,IAAI,CAAC,OAAO;aAChB,IAAI,CAAC,EAAE,CAAC;aACR,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,iBAAI,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,iBAAS,CAAC,YAAY,CAAC,CAAC;aAC/D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,GAAG,GAAS;QAChB,OAAO,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CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,kBAAU,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM,CAAC,EAAM;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;CACF;AAzCD,oBAyCC"}
|
package/dist/process/Manage.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Search } from './Search';
|
|
2
|
-
import { Id, Json } from
|
|
3
|
-
export declare class Manage<T> extends Search<T> {
|
|
2
|
+
import { FetchOptions, Id, Json } from "../types";
|
|
3
|
+
export declare class Manage<T, Options = FetchOptions> extends Search<T, Options> {
|
|
4
4
|
add: (json: Json) => Promise<T>;
|
|
5
5
|
update: (id: Id, json: Json) => Promise<T>;
|
|
6
6
|
upsert: (id: Id, json: Json) => Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manage.js","sourceRoot":"","sources":["../../src/process/Manage.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAGlC,MAAa,
|
|
1
|
+
{"version":3,"file":"Manage.js","sourceRoot":"","sources":["../../src/process/Manage.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAGlC,MAAa,MAAkC,SAAQ,eAAkB;IAAzE;;QACE,QAAG,GAAG,CAAC,IAAU,EAAc,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtD,WAAM,GAAG,CAAC,EAAM,EAAE,IAAU,EAAc,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACxE,WAAM,GAAG,CAAC,EAAM,EAAE,IAAU,EAAc,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACxE,WAAM,GAAG,CAAC,EAAM,EAAoB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC;CAAA;AALD,wBAKC"}
|
package/dist/process/Search.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { Id, JsonValue, Key, PageList,
|
|
1
|
+
import { FetchOptions, Id, JsonValue, Key, PageList, Repository } from '../types';
|
|
2
2
|
import { Req } from '../resources';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
all: (options?: PageOptions) => Promise<PageList<T>>;
|
|
3
|
+
export declare class Search<T, Options = FetchOptions> {
|
|
4
|
+
protected repo: Repository<T, Options>;
|
|
5
|
+
constructor(repo: Repository<T, Options>);
|
|
6
|
+
all: (options?: Options) => Promise<PageList<T>>;
|
|
8
7
|
byId: (id: Id) => Promise<T>;
|
|
9
8
|
byIds: (...ids: Id[]) => Promise<PageList<T>>;
|
|
10
|
-
byKey: (key: Key, options?:
|
|
9
|
+
byKey: (key: Key, options?: Options) => Promise<PageList<T>>;
|
|
11
10
|
query: ({ query, skip, take }: Req) => Promise<PageList<T>>;
|
|
12
|
-
search: (query: JsonValue, options?:
|
|
13
|
-
filter: (options?:
|
|
11
|
+
search: (query: JsonValue, options?: Options) => Promise<PageList<T>>;
|
|
12
|
+
filter: (options?: Options) => Promise<PageList<T>>;
|
|
14
13
|
exists: (id: Id) => Promise<boolean>;
|
|
15
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../src/process/Search.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../src/process/Search.ts"],"names":[],"mappings":";;;AAAA,oCAAkG;AAClG,oCAAmC;AAGnC,MAAa,MAAM;IACjB,YAAsB,IAA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BvD;AAxBD,wBAwBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "12.22.
|
|
3
|
+
"version": "12.22.10",
|
|
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": "12.22.
|
|
34
|
+
"@thisisagile/easy-test": "12.22.10",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^8.5.9",
|
|
37
37
|
"@types/luxon": "3.1.0",
|
package/src/domain/Repo.ts
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
asList,
|
|
3
|
+
asPageList,
|
|
4
|
+
Constructor,
|
|
5
|
+
Exception,
|
|
6
|
+
FetchOptions,
|
|
7
|
+
Gateway,
|
|
8
|
+
Id,
|
|
9
|
+
isValidatable,
|
|
10
|
+
Json,
|
|
11
|
+
JsonValue,
|
|
12
|
+
Key,
|
|
13
|
+
List,
|
|
14
|
+
PageList,
|
|
15
|
+
Repository,
|
|
16
|
+
toJson,
|
|
17
|
+
} from '../types';
|
|
2
18
|
import { when } from '../validation';
|
|
3
19
|
import { reject, resolve } from '../utils';
|
|
4
20
|
import { Struct } from './Struct';
|
|
5
|
-
import { Repository } from '../types';
|
|
6
21
|
|
|
7
|
-
export class Repo<T extends Struct> extends Repository<T> {
|
|
8
|
-
constructor(protected ctor: Constructor<T>, private readonly gateway: Gateway) {
|
|
22
|
+
export class Repo<T extends Struct, Options = FetchOptions> extends Repository<T, Options> {
|
|
23
|
+
constructor(protected ctor: Constructor<T>, private readonly gateway: Gateway<Options>) {
|
|
9
24
|
super();
|
|
10
25
|
}
|
|
11
26
|
|
|
12
27
|
create = (item: T | Json): T => (isValidatable(item) ? item : new this.ctor(item));
|
|
13
28
|
|
|
14
|
-
all(options?:
|
|
29
|
+
all(options?: Options): Promise<PageList<T>> {
|
|
15
30
|
return this.gateway.all(options).then(js => asPageList(this.ctor, js));
|
|
16
31
|
}
|
|
17
32
|
|
|
@@ -26,19 +41,19 @@ export class Repo<T extends Struct> extends Repository<T> {
|
|
|
26
41
|
return this.gateway.byIds(...ids).then(j => asList(this.ctor, j));
|
|
27
42
|
}
|
|
28
43
|
|
|
29
|
-
byKey(key: Key, options?:
|
|
44
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>> {
|
|
30
45
|
return this.gateway.by('key', key, options).then(js => asPageList(this.ctor, js));
|
|
31
46
|
}
|
|
32
47
|
|
|
33
|
-
by(key: keyof T, value: JsonValue, options?:
|
|
48
|
+
by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {
|
|
34
49
|
return this.gateway.by(key.toString(), value, options).then(js => asPageList(this.ctor, js));
|
|
35
50
|
}
|
|
36
51
|
|
|
37
|
-
search(q: JsonValue, options?:
|
|
52
|
+
search(q: JsonValue, options?: Options): Promise<PageList<T>> {
|
|
38
53
|
return this.gateway.search(q, options).then(js => asPageList(this.ctor, js));
|
|
39
54
|
}
|
|
40
55
|
|
|
41
|
-
filter(options?:
|
|
56
|
+
filter(options?: Options): Promise<PageList<T>> {
|
|
42
57
|
return this.gateway.filter(options).then(js => asPageList(this.ctor, js));
|
|
43
58
|
}
|
|
44
59
|
|
package/src/domain/Typo.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { Exception, Gateway, Id, Json, JsonValue, Key, List, PageList,
|
|
1
|
+
import { Exception, FetchOptions, Gateway, Id, Json, JsonValue, Key, List, PageList, Repository, toList, toPageList } from '../types';
|
|
2
2
|
import { when } from '../validation';
|
|
3
3
|
import { View } from '../utils';
|
|
4
|
-
import { Repository } from '../types';
|
|
5
4
|
|
|
6
|
-
export class Typo<T> extends Repository<T> {
|
|
7
|
-
constructor(protected view: View, private readonly gateway: Gateway) {
|
|
5
|
+
export class Typo<T, Options = FetchOptions> extends Repository<T, Options> {
|
|
6
|
+
constructor(protected view: View, private readonly gateway: Gateway<Options>) {
|
|
8
7
|
super();
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
create = (j: Json): T => this.view.from(j) as unknown as T;
|
|
12
11
|
|
|
13
|
-
all(options?:
|
|
12
|
+
all(options?: Options): Promise<PageList<T>> {
|
|
14
13
|
return this.gateway.all(options).then(js => toPageList(js.map(j => this.create(j))));
|
|
15
14
|
}
|
|
16
15
|
|
|
@@ -25,19 +24,19 @@ export class Typo<T> extends Repository<T> {
|
|
|
25
24
|
return this.gateway.byIds(...ids).then(js => toList(js.map(j => this.create(j))));
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
byKey(key: Key, options?:
|
|
27
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>> {
|
|
29
28
|
return this.gateway.by('key', key, options).then(js => toPageList(js.map(j => this.create(j))));
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
by(key: keyof T, value: JsonValue, options?:
|
|
31
|
+
by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {
|
|
33
32
|
return this.gateway.by(key.toString(), value, options).then(js => toPageList(js.map(j => this.create(j))));
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
search(q: JsonValue, options?:
|
|
35
|
+
search(q: JsonValue, options?: Options): Promise<PageList<T>> {
|
|
37
36
|
return this.gateway.search(q, options).then(js => toPageList(js.map(j => this.create(j))));
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
filter(options?:
|
|
39
|
+
filter(options?: Options): Promise<PageList<T>> {
|
|
41
40
|
return this.gateway.filter(options).then(js => toPageList(js.map(j => this.create(j))));
|
|
42
41
|
}
|
|
43
42
|
|
package/src/process/Manage.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Search } from './Search';
|
|
2
|
-
import { Id, Json } from
|
|
2
|
+
import { FetchOptions, Id, Json } from "../types";
|
|
3
3
|
|
|
4
|
-
export class Manage<T> extends Search<T> {
|
|
4
|
+
export class Manage<T, Options = FetchOptions> extends Search<T, Options> {
|
|
5
5
|
add = (json: Json): Promise<T> => this.repo.add(json);
|
|
6
6
|
update = (id: Id, json: Json): Promise<T> => this.repo.update(id, json);
|
|
7
7
|
upsert = (id: Id, json: Json): Promise<T> => this.repo.upsert(id, json);
|
package/src/process/Search.ts
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { choose, Id, JsonValue, Key, PageList,
|
|
1
|
+
import { choose, FetchOptions, Id, JsonValue, Key, PageList, Repository, toList } from '../types';
|
|
2
2
|
import { resolve } from '../utils';
|
|
3
3
|
import { Req } from '../resources';
|
|
4
|
-
import { Repository } from '../types';
|
|
5
4
|
|
|
6
|
-
export class Search<T> {
|
|
7
|
-
constructor(protected repo: Repository<T>) {}
|
|
5
|
+
export class Search<T, Options = FetchOptions> {
|
|
6
|
+
constructor(protected repo: Repository<T, Options>) {}
|
|
8
7
|
|
|
9
|
-
all = (options?:
|
|
8
|
+
all = (options?: Options): Promise<PageList<T>> => this.repo.all(options);
|
|
10
9
|
|
|
11
10
|
byId = (id: Id): Promise<T> => this.repo.byId(id);
|
|
12
11
|
|
|
13
12
|
byIds = (...ids: Id[]): Promise<PageList<T>> => this.repo.byIds(...ids);
|
|
14
13
|
|
|
15
|
-
byKey = (key: Key, options?:
|
|
14
|
+
byKey = (key: Key, options?: Options): Promise<PageList<T>> => this.repo.byKey(key, options);
|
|
16
15
|
|
|
17
|
-
query = ({ query, skip, take }: Req): Promise<PageList<T>> => this.search(query, { skip, take });
|
|
16
|
+
query = ({ query, skip, take }: Req): Promise<PageList<T>> => this.search(query, { skip, take } as Options);
|
|
18
17
|
|
|
19
|
-
search = (query: JsonValue, options?:
|
|
18
|
+
search = (query: JsonValue, options?: Options): Promise<PageList<T>> =>
|
|
20
19
|
choose(query)
|
|
21
20
|
.is.not.empty(
|
|
22
21
|
q => q,
|
|
@@ -24,7 +23,7 @@ export class Search<T> {
|
|
|
24
23
|
)
|
|
25
24
|
.else(() => resolve(toList<T>()));
|
|
26
25
|
|
|
27
|
-
filter = (options?:
|
|
26
|
+
filter = (options?: Options): Promise<PageList<T>> => this.repo.filter(options);
|
|
28
27
|
|
|
29
28
|
exists = (id: Id): Promise<boolean> => this.repo.exists(id);
|
|
30
29
|
}
|