@sentio/runtime 2.19.1-rc.1 → 2.20.0
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/lib/utils.d.ts +2 -1
- package/lib/utils.js +5 -2
- package/lib/utils.js.map +1 -1
- package/package.json +4 -3
- package/src/utils.ts +7 -3
package/lib/utils.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ProcessResult } from '@sentio/protos';
|
2
|
-
|
2
|
+
import { Required } from 'utility-types';
|
3
|
+
export declare function mergeProcessResults(results: ProcessResult[]): Required<ProcessResult, 'states'>;
|
3
4
|
export declare function errorString(e: Error): string;
|
4
5
|
export declare const USER_PROCESSOR = "user_processor";
|
package/lib/utils.js
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
import { ProcessResult } from '@sentio/protos';
|
1
|
+
import { ProcessResult, StateResult } from '@sentio/protos';
|
2
2
|
export function mergeProcessResults(results) {
|
3
|
-
const res =
|
3
|
+
const res = {
|
4
|
+
...ProcessResult.create(),
|
5
|
+
states: StateResult.create(),
|
6
|
+
};
|
4
7
|
for (const r of results) {
|
5
8
|
res.counters = res.counters.concat(r.counters);
|
6
9
|
res.gauges = res.gauges.concat(r.gauges);
|
package/lib/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAG3D,MAAM,UAAU,mBAAmB,CAAC,OAAwB;IAC1D,MAAM,GAAG,GAAG;QACV,GAAG,aAAa,CAAC,MAAM,EAAE;QACzB,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE;KAC7B,CAAA;IAED,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QAC9C,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QACxC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QACxC,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QAC3C,GAAG,CAAC,MAAM,GAAG;YACX,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,IAAI,CAAC,CAAC,MAAM,EAAE,aAAa,IAAI,KAAK;SAC7E,CAAA;KACF;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAQ;IAClC,OAAO,CAAC,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAA;AACnC,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAA","sourcesContent":["import { ProcessResult, StateResult } from '@sentio/protos'\nimport { Required } from 'utility-types'\n\nexport function mergeProcessResults(results: ProcessResult[]): Required<ProcessResult, 'states'> {\n const res = {\n ...ProcessResult.create(),\n states: StateResult.create(),\n }\n\n for (const r of results) {\n res.counters = res.counters.concat(r.counters)\n res.gauges = res.gauges.concat(r.gauges)\n res.events = res.events.concat(r.events)\n res.exports = res.exports.concat(r.exports)\n res.states = {\n configUpdated: res.states?.configUpdated || r.states?.configUpdated || false,\n }\n }\n return res\n}\n\nexport function errorString(e: Error): string {\n return e.message + '\\n' + e.stack\n}\n\nexport const USER_PROCESSOR = 'user_processor'\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentio/runtime",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.20.0",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -28,11 +28,12 @@
|
|
28
28
|
"nice-grpc-prometheus": "^0.1.2",
|
29
29
|
"prom-client": "^14.2.0",
|
30
30
|
"protobufjs": "^7.2.3",
|
31
|
+
"utility-types": "^3.10.0",
|
31
32
|
"winston": "^3.8.2",
|
32
|
-
"@sentio/protos": "2.
|
33
|
+
"@sentio/protos": "2.20.0"
|
33
34
|
},
|
34
35
|
"peerDependencies": {
|
35
|
-
"@sentio/sdk": "^2.
|
36
|
+
"@sentio/sdk": "^2.20.0"
|
36
37
|
},
|
37
38
|
"devDependencies": {
|
38
39
|
"@types/command-line-args": "^5.2.0",
|
package/src/utils.ts
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
import { ProcessResult } from '@sentio/protos'
|
1
|
+
import { ProcessResult, StateResult } from '@sentio/protos'
|
2
|
+
import { Required } from 'utility-types'
|
2
3
|
|
3
|
-
export function mergeProcessResults(results: ProcessResult[]): ProcessResult {
|
4
|
-
const res =
|
4
|
+
export function mergeProcessResults(results: ProcessResult[]): Required<ProcessResult, 'states'> {
|
5
|
+
const res = {
|
6
|
+
...ProcessResult.create(),
|
7
|
+
states: StateResult.create(),
|
8
|
+
}
|
5
9
|
|
6
10
|
for (const r of results) {
|
7
11
|
res.counters = res.counters.concat(r.counters)
|