@thisisagile/easy 7.40.4 → 7.40.5
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.
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Api } from './Api';
|
|
2
2
|
import { Func, Gateway, Id, Json, JsonValue, List, Uri } from '../types';
|
|
3
|
-
export declare class RouteGateway
|
|
3
|
+
export declare class RouteGateway extends Gateway {
|
|
4
4
|
readonly route: Func<Uri>;
|
|
5
5
|
readonly routeId: Func<Uri>;
|
|
6
6
|
readonly api: Api;
|
|
7
7
|
constructor(route: Func<Uri>, routeId: Func<Uri>, api?: Api);
|
|
8
8
|
all(): Promise<List<Json>>;
|
|
9
9
|
byId(id: Id): Promise<Json | undefined>;
|
|
10
|
-
by(_key: string, _value: JsonValue): Promise<List<Json>>;
|
|
11
10
|
search(q: JsonValue): Promise<List<Json>>;
|
|
12
11
|
exists(id: Id): Promise<boolean>;
|
|
13
12
|
add(item: Json): Promise<Json>;
|
|
@@ -4,9 +4,9 @@ exports.RouteGateway = void 0;
|
|
|
4
4
|
const Api_1 = require("./Api");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
const http_1 = require("../http");
|
|
7
|
-
|
|
8
|
-
class RouteGateway {
|
|
7
|
+
class RouteGateway extends types_1.Gateway {
|
|
9
8
|
constructor(route, routeId, api = new Api_1.Api()) {
|
|
9
|
+
super();
|
|
10
10
|
this.route = route;
|
|
11
11
|
this.routeId = routeId;
|
|
12
12
|
this.api = api;
|
|
@@ -17,9 +17,6 @@ class RouteGateway {
|
|
|
17
17
|
byId(id) {
|
|
18
18
|
return this.api.get(this.routeId().id(id)).then(r => r.body.data?.items.first());
|
|
19
19
|
}
|
|
20
|
-
by(_key, _value) {
|
|
21
|
-
return (0, utils_1.reject)(types_1.Exception.IsNotImplemented);
|
|
22
|
-
}
|
|
23
20
|
search(q) {
|
|
24
21
|
return this.api.get(this.route().query(q)).then(r => r.body.data?.items ?? (0, types_1.toList)());
|
|
25
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteGateway.js","sourceRoot":"","sources":["../../src/services/RouteGateway.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"RouteGateway.js","sourceRoot":"","sources":["../../src/services/RouteGateway.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,oCAAiF;AACjF,kCAAqC;AAErC,MAAa,YAAa,SAAQ,eAAO;IACvC,YAAqB,KAAgB,EAAW,OAAkB,EAAW,MAAW,IAAI,SAAG,EAAE;QAC/F,KAAK,EAAE,CAAC;QADW,UAAK,GAAL,KAAK,CAAW;QAAW,YAAO,GAAP,OAAO,CAAW;QAAW,QAAG,GAAH,GAAG,CAAiB;IAEjG,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAA,cAAM,GAAE,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,CAAC,EAAM;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,CAAC,CAAY;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAA,cAAM,GAAE,CAAC,C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C,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,MAAM,CAAC,EAAM;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;CACF;AAvCD,oCAuCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "7.40.
|
|
3
|
+
"version": "7.40.5",
|
|
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": "7.40.
|
|
34
|
+
"@thisisagile/easy-test": "7.40.5",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^8.5.5",
|
|
37
37
|
"@types/validator": "^13.6.6"
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Api } from './Api';
|
|
2
|
-
import {
|
|
2
|
+
import { Func, Gateway, Id, Json, JsonValue, List, toList, Uri } from '../types';
|
|
3
3
|
import { HttpStatus } from '../http';
|
|
4
|
-
import { reject } from '../utils';
|
|
5
4
|
|
|
6
|
-
export class RouteGateway
|
|
7
|
-
constructor(readonly route: Func<Uri>, readonly routeId: Func<Uri>, readonly api: Api = new Api()) {
|
|
5
|
+
export class RouteGateway extends Gateway {
|
|
6
|
+
constructor(readonly route: Func<Uri>, readonly routeId: Func<Uri>, readonly api: Api = new Api()) {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
8
9
|
|
|
9
10
|
all(): Promise<List<Json>> {
|
|
10
11
|
return this.api.get(this.route()).then(r => r.body.data?.items ?? toList());
|
|
@@ -14,10 +15,6 @@ export class RouteGateway implements Gateway {
|
|
|
14
15
|
return this.api.get(this.routeId().id(id)).then(r => r.body.data?.items.first());
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
by(_key: string, _value: JsonValue): Promise<List<Json>> {
|
|
18
|
-
return reject(Exception.IsNotImplemented);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
18
|
search(q: JsonValue): Promise<List<Json>> {
|
|
22
19
|
return this.api.get(this.route().query(q)).then(r => r.body.data?.items ?? toList());
|
|
23
20
|
}
|