@comunica/actor-query-result-serialize-stats 4.5.0 → 5.0.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/README.md CHANGED
@@ -23,7 +23,7 @@ After installing, this package can be added to your engine's configuration as fo
23
23
  {
24
24
  "@context": [
25
25
  ...
26
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^4.0.0/components/context.jsonld"
26
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^5.0.0/components/context.jsonld"
27
27
  ],
28
28
  "actors": [
29
29
  ...
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http-invalidate/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
6
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http-invalidate/^5.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
6
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^5.0.0/components/context.jsonld"
7
7
  ],
8
8
  "@id": "npmd:@comunica/actor-query-result-serialize-stats",
9
9
  "components": [
@@ -28,7 +28,7 @@
28
28
  "range": "cbhi:components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable",
29
29
  "default": {
30
30
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#IActionObserverHttpArgs_default_invalidator",
31
- "@type": "npmd:@comunica/bus-http-invalidate/^4.0.0/components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable"
31
+ "@type": "npmd:@comunica/bus-http-invalidate/^5.0.0/components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable"
32
32
  },
33
33
  "comment": "An actor that listens to HTTP invalidation events"
34
34
  },
@@ -65,40 +65,40 @@
65
65
  "genericTypeInstances": [
66
66
  {
67
67
  "@type": "ParameterRangeGenericTypeReference",
68
- "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_I"
68
+ "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_I"
69
69
  },
70
70
  {
71
71
  "@type": "ParameterRangeWildcard"
72
72
  },
73
73
  {
74
74
  "@type": "ParameterRangeGenericTypeReference",
75
- "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_O"
75
+ "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_O"
76
76
  },
77
77
  {
78
78
  "@type": "ParameterRangeGenericTypeReference",
79
- "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_TS"
79
+ "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_TS"
80
80
  }
81
81
  ]
82
82
  },
83
83
  {
84
84
  "@type": "ParameterRangeGenericTypeReference",
85
- "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_I"
85
+ "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_I"
86
86
  },
87
87
  {
88
88
  "@type": "ParameterRangeWildcard"
89
89
  },
90
90
  {
91
91
  "@type": "ParameterRangeGenericTypeReference",
92
- "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_O"
92
+ "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_O"
93
93
  },
94
94
  {
95
95
  "@type": "ParameterRangeGenericTypeReference",
96
- "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_TS"
96
+ "parameterRangeGenericType": "npmd:@comunica/actor-query-result-serialize-sparql-json/^5.0.0/components/ActionObserverHttp.jsonld#ActionObserverHttp__generic_TS"
97
97
  }
98
98
  ]
99
99
  },
100
100
  "default": {
101
- "@id": "npmd:@comunica/bus-http/^4.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus"
101
+ "@id": "npmd:@comunica/bus-http/^5.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus"
102
102
  },
103
103
  "comment": "The bus this observer can subscribe to."
104
104
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-result-serialize/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-result-serialize/^5.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-query-result-serialize-stats",
8
8
  "components": [
@@ -78,37 +78,37 @@
78
78
  "genericTypeInstances": [
79
79
  {
80
80
  "@type": "ParameterRangeGenericTypeReference",
81
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
81
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
82
82
  },
83
83
  {
84
84
  "@type": "ParameterRangeGenericTypeReference",
85
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
85
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
86
86
  },
87
87
  {
88
88
  "@type": "ParameterRangeGenericTypeReference",
89
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
89
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
90
90
  },
91
91
  {
92
92
  "@type": "ParameterRangeGenericTypeReference",
93
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
93
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
94
94
  }
95
95
  ]
96
96
  },
97
97
  {
98
98
  "@type": "ParameterRangeGenericTypeReference",
99
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
99
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
100
100
  },
101
101
  {
102
102
  "@type": "ParameterRangeGenericTypeReference",
103
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
103
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
104
104
  },
105
105
  {
106
106
  "@type": "ParameterRangeGenericTypeReference",
107
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
107
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
108
108
  },
109
109
  {
110
110
  "@type": "ParameterRangeGenericTypeReference",
111
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
111
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
112
112
  }
113
113
  ]
114
114
  },
@@ -145,19 +145,19 @@
145
145
  "genericTypeInstances": [
146
146
  {
147
147
  "@type": "ParameterRangeGenericTypeReference",
148
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
148
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
149
149
  },
150
150
  {
151
151
  "@type": "ParameterRangeGenericTypeReference",
152
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
152
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
153
153
  },
154
154
  {
155
155
  "@type": "ParameterRangeGenericTypeReference",
156
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
156
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
157
157
  },
158
158
  {
159
159
  "@type": "ParameterRangeGenericTypeReference",
160
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
160
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
161
161
  }
162
162
  ]
163
163
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-query-result-serialize-stats",
6
6
  "@type": "Module",
@@ -3,7 +3,7 @@
3
3
  "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
4
4
  {
5
5
  "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
- "caqrsst": "npmd:@comunica/actor-query-result-serialize-stats/^4.0.0/",
6
+ "caqrsst": "npmd:@comunica/actor-query-result-serialize-stats/^5.0.0/",
7
7
  "ActionObserverHttp": {
8
8
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp",
9
9
  "@prefix": true,
@@ -10,7 +10,7 @@ export declare class ActionObserverHttp extends ActionObserver<IActionHttp, IAct
10
10
  readonly observedActors: string[];
11
11
  requests: number;
12
12
  /**
13
- * @param args - @defaultNested {<npmd:@comunica/bus-http/^4.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus>} bus
13
+ * @param args - @defaultNested {<npmd:@comunica/bus-http/^5.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus>} bus
14
14
  */
15
15
  constructor(args: IActionObserverHttpArgs);
16
16
  onRun(actor: Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>, _action: IActionHttp, _output: Promise<IActorHttpOutput>): void;
@@ -18,7 +18,7 @@ export declare class ActionObserverHttp extends ActionObserver<IActionHttp, IAct
18
18
  export interface IActionObserverHttpArgs extends IActionObserverArgs<IActionHttp, IActorHttpOutput> {
19
19
  /**
20
20
  * An actor that listens to HTTP invalidation events
21
- * @default {<default_invalidator> a <npmd:@comunica/bus-http-invalidate/^4.0.0/components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable>}
21
+ * @default {<default_invalidator> a <npmd:@comunica/bus-http-invalidate/^5.0.0/components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable>}
22
22
  */
23
23
  httpInvalidator: ActorHttpInvalidateListenable;
24
24
  /**
@@ -6,13 +6,17 @@ const core_1 = require("@comunica/core");
6
6
  * Observes HTTP actions, and maintains a counter of the number of requests.
7
7
  */
8
8
  class ActionObserverHttp extends core_1.ActionObserver {
9
+ httpInvalidator;
10
+ observedActors;
11
+ requests = 0;
9
12
  /* eslint-disable max-len */
10
13
  /**
11
- * @param args - @defaultNested {<npmd:@comunica/bus-http/^4.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus>} bus
14
+ * @param args - @defaultNested {<npmd:@comunica/bus-http/^5.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus>} bus
12
15
  */
13
16
  constructor(args) {
14
17
  super(args);
15
- this.requests = 0;
18
+ this.httpInvalidator = args.httpInvalidator;
19
+ this.observedActors = args.observedActors;
16
20
  this.bus.subscribeObserver(this);
17
21
  this.httpInvalidator.addInvalidateListener(() => {
18
22
  this.requests = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionObserverHttp.js","sourceRoot":"","sources":["ActionObserverHttp.ts"],"names":[],"mappings":";;;AAGA,yCAAgD;AAEhD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,qBAA6C;IAKnF,4BAA4B;IAC5B;;OAEG;IACH,YAAmB,IAA6B;QAC9C,KAAK,CAAC,IAAI,CAAC,CAAC;QAPP,aAAQ,GAAG,CAAC,CAAC;QAQlB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,GAAG,EAAE;YAC9C,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,2BAA2B;IAEpB,KAAK,CACV,KAAkE,EAClE,OAAoB,EACpB,OAAkC;QAElC,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;CACF;AA3BD,gDA2BC","sourcesContent":["import type { IActionHttp, IActorHttpOutput } from '@comunica/bus-http';\nimport type { ActorHttpInvalidateListenable } from '@comunica/bus-http-invalidate';\nimport type { Actor, IActionObserverArgs, IActorTest } from '@comunica/core';\nimport { ActionObserver } from '@comunica/core';\n\n/**\n * Observes HTTP actions, and maintains a counter of the number of requests.\n */\nexport class ActionObserverHttp extends ActionObserver<IActionHttp, IActorHttpOutput> {\n public readonly httpInvalidator: ActorHttpInvalidateListenable;\n public readonly observedActors: string[];\n public requests = 0;\n\n /* eslint-disable max-len */\n /**\n * @param args - @defaultNested {<npmd:@comunica/bus-http/^4.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus>} bus\n */\n public constructor(args: IActionObserverHttpArgs) {\n super(args);\n this.bus.subscribeObserver(this);\n this.httpInvalidator.addInvalidateListener(() => {\n this.requests = 0;\n });\n }\n /* eslint-enable max-len */\n\n public onRun(\n actor: Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>,\n _action: IActionHttp,\n _output: Promise<IActorHttpOutput>,\n ): void {\n if (this.observedActors.includes(actor.name)) {\n this.requests++;\n }\n }\n}\n\nexport interface IActionObserverHttpArgs extends IActionObserverArgs<IActionHttp, IActorHttpOutput> {\n /* eslint-disable max-len */\n /**\n * An actor that listens to HTTP invalidation events\n * @default {<default_invalidator> a <npmd:@comunica/bus-http-invalidate/^4.0.0/components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable>}\n */\n httpInvalidator: ActorHttpInvalidateListenable;\n /* eslint-enable max-len */\n /**\n * The URIs of the observed actors.\n * @default {urn:comunica:default:http/actors#fetch}\n */\n observedActors: string[];\n}\n"]}
1
+ {"version":3,"file":"ActionObserverHttp.js","sourceRoot":"","sources":["ActionObserverHttp.ts"],"names":[],"mappings":";;;AAGA,yCAAgD;AAEhD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,qBAA6C;IACnE,eAAe,CAAgC;IAC/C,cAAc,CAAW;IAClC,QAAQ,GAAG,CAAC,CAAC;IAEpB,4BAA4B;IAC5B;;OAEG;IACH,YAAmB,IAA6B;QAC9C,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,GAAG,EAAE;YAC9C,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,2BAA2B;IAEpB,KAAK,CACV,KAAkE,EAClE,OAAoB,EACpB,OAAkC;QAElC,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;CACF;AA7BD,gDA6BC","sourcesContent":["import type { IActionHttp, IActorHttpOutput } from '@comunica/bus-http';\nimport type { ActorHttpInvalidateListenable } from '@comunica/bus-http-invalidate';\nimport type { Actor, IActionObserverArgs, IActorTest } from '@comunica/core';\nimport { ActionObserver } from '@comunica/core';\n\n/**\n * Observes HTTP actions, and maintains a counter of the number of requests.\n */\nexport class ActionObserverHttp extends ActionObserver<IActionHttp, IActorHttpOutput> {\n public readonly httpInvalidator: ActorHttpInvalidateListenable;\n public readonly observedActors: string[];\n public requests = 0;\n\n /* eslint-disable max-len */\n /**\n * @param args - @defaultNested {<npmd:@comunica/bus-http/^5.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus>} bus\n */\n public constructor(args: IActionObserverHttpArgs) {\n super(args);\n this.httpInvalidator = args.httpInvalidator;\n this.observedActors = args.observedActors;\n this.bus.subscribeObserver(this);\n this.httpInvalidator.addInvalidateListener(() => {\n this.requests = 0;\n });\n }\n /* eslint-enable max-len */\n\n public onRun(\n actor: Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>,\n _action: IActionHttp,\n _output: Promise<IActorHttpOutput>,\n ): void {\n if (this.observedActors.includes(actor.name)) {\n this.requests++;\n }\n }\n}\n\nexport interface IActionObserverHttpArgs extends IActionObserverArgs<IActionHttp, IActorHttpOutput> {\n /* eslint-disable max-len */\n /**\n * An actor that listens to HTTP invalidation events\n * @default {<default_invalidator> a <npmd:@comunica/bus-http-invalidate/^5.0.0/components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable>}\n */\n httpInvalidator: ActorHttpInvalidateListenable;\n /* eslint-enable max-len */\n /**\n * The URIs of the observed actors.\n * @default {urn:comunica:default:http/actors#fetch}\n */\n observedActors: string[];\n}\n"]}
File without changes
@@ -10,6 +10,7 @@ const readable_stream_1 = require("readable-stream");
10
10
  * Serializes SPARQL results for testing and debugging.
11
11
  */
12
12
  class ActorQueryResultSerializeStats extends bus_query_result_serialize_1.ActorQueryResultSerializeFixedMediaTypes {
13
+ httpObserver;
13
14
  /* eslint-disable max-len */
14
15
  /**
15
16
  * @param args -
@@ -19,6 +20,7 @@ class ActorQueryResultSerializeStats extends bus_query_result_serialize_1.ActorQ
19
20
  */
20
21
  constructor(args) {
21
22
  super(args);
23
+ this.httpObserver = args.httpObserver;
22
24
  }
23
25
  /* eslint-enable max-len */
24
26
  async testHandleChecked(action, _context) {
@@ -1 +1 @@
1
- {"version":3,"file":"ActorQueryResultSerializeStats.js","sourceRoot":"","sources":["ActorQueryResultSerializeStats.ts"],"names":[],"mappings":";;;AAKA,qFAAgG;AAChG,+DAA0D;AAE1D,yCAAwD;AAMxD,iDAAqC;AACrC,qDAA2C;AAG3C;;GAEG;AACH,MAAa,8BAA+B,SAAQ,qEAAwC;IAG1F,4BAA4B;IAC5B;;;;;OAKG;IACH,YAAmB,IAAyC;QAC1D,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IACD,2BAA2B;IAEX,KAAK,CAAC,iBAAiB,CACrC,MAA8B,EAC9B,QAAwB;QAExB,IAAI,CAAC,CAAE,UAAU,EAAE,OAAO,CAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,OAAO,IAAA,eAAQ,EAAC,8DAA8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AAC;QACD,MAAM,MAAM,GAAG,IAAA,oBAAI,EAAC,YAAY,CAAC;aAC9B,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;aAC/C,OAAO,CAAC,CAAE,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAE,CAAC;aAC1D,MAAM,CAAC,IAAA,oBAAI,EAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,CAAO,MAAM,CAAC,CAAC;QAExB,OAAO,EAAE,IAAI,EAAE,CAAC;IAClB,CAAC;IAEM,GAAG;QACR,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IAChC,CAAC;CACF;AA3ED,wEA2EC","sourcesContent":["import type {\n IActionSparqlSerialize,\n IActorQueryResultSerializeFixedMediaTypesArgs,\n IActorQueryResultSerializeOutput,\n} from '@comunica/bus-query-result-serialize';\nimport { ActorQueryResultSerializeFixedMediaTypes } from '@comunica/bus-query-result-serialize';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport type {\n IActionContext,\n IQueryOperationResultBindings,\n IQueryOperationResultQuads,\n} from '@comunica/types';\nimport { wrap } from 'asynciterator';\nimport { Readable } from 'readable-stream';\nimport type { ActionObserverHttp } from './ActionObserverHttp';\n\n/**\n * Serializes SPARQL results for testing and debugging.\n */\nexport class ActorQueryResultSerializeStats extends ActorQueryResultSerializeFixedMediaTypes {\n public readonly httpObserver: ActionObserverHttp;\n\n /* eslint-disable max-len */\n /**\n * @param args -\n * \\ @defaultNested {{ \"stats\": 0.5 }} mediaTypePriorities\n * \\ @defaultNested {{ \"stats\": \"https://comunica.linkeddatafragments.org/#results_stats\" }} mediaTypeFormats\n * \\ @defaultNested {<default_observer> a <caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp>} httpObserver\n */\n public constructor(args: IActorQueryResultSerializeStatsArgs) {\n super(args);\n }\n /* eslint-enable max-len */\n\n public override async testHandleChecked(\n action: IActionSparqlSerialize,\n _context: IActionContext,\n ): Promise<TestResult<boolean>> {\n if (![ 'bindings', 'quads' ].includes(action.type)) {\n return failTest('This actor can only handle bindings streams or quad streams.');\n }\n return passTestVoid();\n }\n\n public pushHeader(data: Readable): void {\n const header: string = [ 'Result', 'Delay (ms)', 'HTTP requests',\n ].join(',');\n data.push(`${header}\\n`);\n }\n\n public createStat(startTime: number, result: number): string {\n const row: string = [ result, this.delay(startTime), this.httpObserver.requests,\n ].join(',');\n return `${row}\\n`;\n }\n\n public createSpecialLine(label: string, startTime: number): string {\n const line: string = [ label, this.delay(startTime), this.httpObserver.requests,\n ].join(',');\n return `${line}\\n`;\n }\n\n public async runHandle(action: IActionSparqlSerialize, _mediaType: string, _context: IActionContext):\n Promise<IActorQueryResultSerializeOutput> {\n const data = new Readable();\n\n const resultStream = action.type === 'bindings' ?\n (<IQueryOperationResultBindings> action).bindingsStream :\n (<IQueryOperationResultQuads> action).quadStream;\n\n const startTime: number = action.context.getSafe(KeysInitQuery.queryTimestampHighResolution);\n let result = 1;\n\n function* end(cb: () => string): Generator<string> {\n yield cb();\n }\n const stream = wrap(resultStream)\n .map(() => this.createStat(startTime, result++))\n .prepend([ this.createSpecialLine('PLANNING', startTime) ])\n .append(wrap(end(() => this.createSpecialLine('TOTAL', startTime))));\n\n this.pushHeader(data);\n data.wrap(<any> stream);\n\n return { data };\n }\n\n public now(): number {\n return performance.now();\n }\n\n public delay(startTime: number): number {\n return this.now() - startTime;\n }\n}\n\nexport interface IActorQueryResultSerializeStatsArgs extends IActorQueryResultSerializeFixedMediaTypesArgs {\n httpObserver: ActionObserverHttp;\n}\n"]}
1
+ {"version":3,"file":"ActorQueryResultSerializeStats.js","sourceRoot":"","sources":["ActorQueryResultSerializeStats.ts"],"names":[],"mappings":";;;AAKA,qFAAgG;AAChG,+DAA0D;AAE1D,yCAAwD;AAMxD,iDAAqC;AACrC,qDAA2C;AAG3C;;GAEG;AACH,MAAa,8BAA+B,SAAQ,qEAAwC;IAC1E,YAAY,CAAqB;IAEjD,4BAA4B;IAC5B;;;;;OAKG;IACH,YAAmB,IAAyC;QAC1D,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IACD,2BAA2B;IAEX,KAAK,CAAC,iBAAiB,CACrC,MAA8B,EAC9B,QAAwB;QAExB,IAAI,CAAC,CAAE,UAAU,EAAE,OAAO,CAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,OAAO,IAAA,eAAQ,EAAC,8DAA8D,CAAC,CAAC;QAClF,CAAC;QACD,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,UAAU,CAAC,IAAc;QAC9B,MAAM,MAAM,GAAW,CAAE,QAAQ,EAAE,YAAY,EAAE,eAAe;SAC/D,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEM,UAAU,CAAC,SAAiB,EAAE,MAAc;QACjD,MAAM,GAAG,GAAW,CAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ;SAC9E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACZ,OAAO,GAAG,GAAG,IAAI,CAAC;IACpB,CAAC;IAEM,iBAAiB,CAAC,KAAa,EA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AAO,WAAW,CAAC,GAAG,EAAE,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IAChC,CAAC;CACF;AA5ED,wEA4EC","sourcesContent":["import type {\n IActionSparqlSerialize,\n IActorQueryResultSerializeFixedMediaTypesArgs,\n IActorQueryResultSerializeOutput,\n} from '@comunica/bus-query-result-serialize';\nimport { ActorQueryResultSerializeFixedMediaTypes } from '@comunica/bus-query-result-serialize';\nimport { KeysInitQuery } from '@comunica/context-entries';\nimport type { TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport type {\n IActionContext,\n IQueryOperationResultBindings,\n IQueryOperationResultQuads,\n} from '@comunica/types';\nimport { wrap } from 'asynciterator';\nimport { Readable } from 'readable-stream';\nimport type { ActionObserverHttp } from './ActionObserverHttp';\n\n/**\n * Serializes SPARQL results for testing and debugging.\n */\nexport class ActorQueryResultSerializeStats extends ActorQueryResultSerializeFixedMediaTypes {\n public readonly httpObserver: ActionObserverHttp;\n\n /* eslint-disable max-len */\n /**\n * @param args -\n * \\ @defaultNested {{ \"stats\": 0.5 }} mediaTypePriorities\n * \\ @defaultNested {{ \"stats\": \"https://comunica.linkeddatafragments.org/#results_stats\" }} mediaTypeFormats\n * \\ @defaultNested {<default_observer> a <caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp>} httpObserver\n */\n public constructor(args: IActorQueryResultSerializeStatsArgs) {\n super(args);\n this.httpObserver = args.httpObserver;\n }\n /* eslint-enable max-len */\n\n public override async testHandleChecked(\n action: IActionSparqlSerialize,\n _context: IActionContext,\n ): Promise<TestResult<boolean>> {\n if (![ 'bindings', 'quads' ].includes(action.type)) {\n return failTest('This actor can only handle bindings streams or quad streams.');\n }\n return passTestVoid();\n }\n\n public pushHeader(data: Readable): void {\n const header: string = [ 'Result', 'Delay (ms)', 'HTTP requests',\n ].join(',');\n data.push(`${header}\\n`);\n }\n\n public createStat(startTime: number, result: number): string {\n const row: string = [ result, this.delay(startTime), this.httpObserver.requests,\n ].join(',');\n return `${row}\\n`;\n }\n\n public createSpecialLine(label: string, startTime: number): string {\n const line: string = [ label, this.delay(startTime), this.httpObserver.requests,\n ].join(',');\n return `${line}\\n`;\n }\n\n public async runHandle(action: IActionSparqlSerialize, _mediaType: string, _context: IActionContext):\n Promise<IActorQueryResultSerializeOutput> {\n const data = new Readable();\n\n const resultStream = action.type === 'bindings' ?\n (<IQueryOperationResultBindings> action).bindingsStream :\n (<IQueryOperationResultQuads> action).quadStream;\n\n const startTime: number = action.context.getSafe(KeysInitQuery.queryTimestampHighResolution);\n let result = 1;\n\n function* end(cb: () => string): Generator<string> {\n yield cb();\n }\n const stream = wrap(resultStream)\n .map(() => this.createStat(startTime, result++))\n .prepend([ this.createSpecialLine('PLANNING', startTime) ])\n .append(wrap(end(() => this.createSpecialLine('TOTAL', startTime))));\n\n this.pushHeader(data);\n data.wrap(<any> stream);\n\n return { data };\n }\n\n public now(): number {\n return performance.now();\n }\n\n public delay(startTime: number): number {\n return this.now() - startTime;\n }\n}\n\nexport interface IActorQueryResultSerializeStatsArgs extends IActorQueryResultSerializeFixedMediaTypesArgs {\n httpObserver: ActionObserverHttp;\n}\n"]}
package/lib/index.d.ts CHANGED
File without changes
package/lib/index.js CHANGED
File without changes
package/lib/index.js.map CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/actor-query-result-serialize-stats",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "A stats query-result-serialize actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -41,14 +41,14 @@
41
41
  "build:components": "componentsjs-generator"
42
42
  },
43
43
  "dependencies": {
44
- "@comunica/bus-http": "^4.5.0",
45
- "@comunica/bus-http-invalidate": "^4.5.0",
46
- "@comunica/bus-query-result-serialize": "^4.5.0",
47
- "@comunica/context-entries": "^4.5.0",
48
- "@comunica/core": "^4.5.0",
49
- "@comunica/types": "^4.5.0",
50
- "asynciterator": "^3.9.0",
51
- "readable-stream": "^4.5.2"
44
+ "@comunica/bus-http": "^5.0.0",
45
+ "@comunica/bus-http-invalidate": "^5.0.0",
46
+ "@comunica/bus-query-result-serialize": "^5.0.0",
47
+ "@comunica/context-entries": "^5.0.0",
48
+ "@comunica/core": "^5.0.0",
49
+ "@comunica/types": "^5.0.0",
50
+ "asynciterator": "^3.10.0",
51
+ "readable-stream": "^4.7.0"
52
52
  },
53
- "gitHead": "2bcd98c387a021fc5c08d375793c205ca3d1bf0d"
53
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
54
54
  }