@routr/location 2.0.6-alpha.1 → 2.0.6-alpha.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/errors.d.ts +2 -2
- package/dist/redis_store.js +26 -12
- package/package.json +4 -4
package/dist/errors.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as grpc from "@grpc/grpc-js";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type LocationError = UnsupportedSchema | NotRoutesFoundForAOR;
|
|
3
|
+
export type InvalidConfiguration = BadAlgorithmAndAffinityCombination | InvalidSchemaConfiguration;
|
|
4
4
|
/**
|
|
5
5
|
* Error thrown when the location service returns an unsupported schema.
|
|
6
6
|
*/
|
package/dist/redis_store.js
CHANGED
|
@@ -48,23 +48,30 @@ class RedisStore {
|
|
|
48
48
|
}
|
|
49
49
|
/** @inheritdoc */
|
|
50
50
|
get(key) {
|
|
51
|
-
var e_1,
|
|
51
|
+
var _a, e_1, _b, _c;
|
|
52
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
53
|
const routes = [];
|
|
54
54
|
try {
|
|
55
55
|
// eslint-disable-next-line no-loops/no-loops
|
|
56
|
-
for (var
|
|
56
|
+
for (var _d = true, _e = __asyncValues(yield this.client.scanIterator({
|
|
57
57
|
CURSOR: 0,
|
|
58
58
|
MATCH: `${key}:*`
|
|
59
|
-
})),
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
})), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
|
|
60
|
+
_c = _f.value;
|
|
61
|
+
_d = false;
|
|
62
|
+
try {
|
|
63
|
+
const k = _c;
|
|
64
|
+
routes.push(JSON.parse(yield this.client.get(k)));
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
_d = true;
|
|
68
|
+
}
|
|
62
69
|
}
|
|
63
70
|
}
|
|
64
71
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
65
72
|
finally {
|
|
66
73
|
try {
|
|
67
|
-
if (
|
|
74
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
68
75
|
}
|
|
69
76
|
finally { if (e_1) throw e_1.error; }
|
|
70
77
|
}
|
|
@@ -73,22 +80,29 @@ class RedisStore {
|
|
|
73
80
|
}
|
|
74
81
|
/** @inheritdoc */
|
|
75
82
|
delete(key) {
|
|
76
|
-
var e_2,
|
|
83
|
+
var _a, e_2, _b, _c;
|
|
77
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
85
|
try {
|
|
79
86
|
// eslint-disable-next-line no-loops/no-loops
|
|
80
|
-
for (var
|
|
87
|
+
for (var _d = true, _e = __asyncValues(yield this.client.scanIterator({
|
|
81
88
|
CURSOR: 0,
|
|
82
89
|
MATCH: `${key}:*`
|
|
83
|
-
})),
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
})), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
|
|
91
|
+
_c = _f.value;
|
|
92
|
+
_d = false;
|
|
93
|
+
try {
|
|
94
|
+
const k = _c;
|
|
95
|
+
yield this.client.del(k);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
_d = true;
|
|
99
|
+
}
|
|
86
100
|
}
|
|
87
101
|
}
|
|
88
102
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
89
103
|
finally {
|
|
90
104
|
try {
|
|
91
|
-
if (
|
|
105
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
92
106
|
}
|
|
93
107
|
finally { if (e_2) throw e_2.error; }
|
|
94
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/location",
|
|
3
|
-
"version": "2.0.6-alpha.
|
|
3
|
+
"version": "2.0.6-alpha.2",
|
|
4
4
|
"description": "Creates and maintains a list of routes to all registered endpoints",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
|
36
36
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
37
37
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
38
|
-
"@routr/common": "^2.0.6-alpha.
|
|
39
|
-
"@routr/processor": "^2.0.6-alpha.
|
|
38
|
+
"@routr/common": "^2.0.6-alpha.2",
|
|
39
|
+
"@routr/processor": "^2.0.6-alpha.2",
|
|
40
40
|
"ajv": "^6.12.6",
|
|
41
41
|
"fp-ts": "^2.11.8",
|
|
42
42
|
"redis": "^4.0.4"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"bugs": {
|
|
49
49
|
"url": "https://github.com/fonoster/routr/issues"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "d933de33862f322730e0b3dd01ec3c009d4f2fad"
|
|
52
52
|
}
|