@comunica/actor-query-result-serialize-stats 4.1.0 → 4.4.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.
@@ -32,6 +32,19 @@
32
32
  },
33
33
  "comment": "An actor that listens to HTTP invalidation events"
34
34
  },
35
+ {
36
+ "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_observedActors",
37
+ "range": {
38
+ "@type": "ParameterRangeArray",
39
+ "parameterRangeValue": "xsd:string"
40
+ },
41
+ "default": {
42
+ "@list": [
43
+ "urn:comunica:default:http/actors#fetch"
44
+ ]
45
+ },
46
+ "comment": "The URIs of the observed actors."
47
+ },
35
48
  {
36
49
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_name",
37
50
  "range": "xsd:string",
@@ -96,6 +109,14 @@
96
109
  "memberFieldName": "httpInvalidator",
97
110
  "range": "cbhi:components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable"
98
111
  },
112
+ {
113
+ "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp__member_observedActors",
114
+ "memberFieldName": "observedActors",
115
+ "range": {
116
+ "@type": "ParameterRangeArray",
117
+ "parameterRangeValue": "xsd:string"
118
+ }
119
+ },
99
120
  {
100
121
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp__member_requests",
101
122
  "memberFieldName": "requests",
@@ -120,6 +141,12 @@
120
141
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_httpInvalidator"
121
142
  }
122
143
  },
144
+ {
145
+ "keyRaw": "observedActors",
146
+ "value": {
147
+ "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_observedActors"
148
+ }
149
+ },
123
150
  {
124
151
  "keyRaw": "name",
125
152
  "value": {
@@ -155,6 +182,10 @@
155
182
  {
156
183
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#IActionObserverHttpArgs__member_httpInvalidator",
157
184
  "memberFieldName": "httpInvalidator"
185
+ },
186
+ {
187
+ "@id": "caqrsst:components/ActionObserverHttp.jsonld#IActionObserverHttpArgs__member_observedActors",
188
+ "memberFieldName": "observedActors"
158
189
  }
159
190
  ],
160
191
  "constructorArguments": []
File without changes
File without changes
@@ -11,6 +11,10 @@
11
11
  "args_httpInvalidator": {
12
12
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_httpInvalidator"
13
13
  },
14
+ "args_observedActors": {
15
+ "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_observedActors",
16
+ "@container": "@list"
17
+ },
14
18
  "args_name": {
15
19
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_name"
16
20
  },
@@ -20,6 +24,10 @@
20
24
  "httpInvalidator": {
21
25
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_httpInvalidator"
22
26
  },
27
+ "observedActors": {
28
+ "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_observedActors",
29
+ "@container": "@list"
30
+ },
23
31
  "name": {
24
32
  "@id": "caqrsst:components/ActionObserverHttp.jsonld#ActionObserverHttp_args_name"
25
33
  },
@@ -7,12 +7,13 @@ import { ActionObserver } from '@comunica/core';
7
7
  */
8
8
  export declare class ActionObserverHttp extends ActionObserver<IActionHttp, IActorHttpOutput> {
9
9
  readonly httpInvalidator: ActorHttpInvalidateListenable;
10
+ readonly observedActors: string[];
10
11
  requests: number;
11
12
  /**
12
13
  * @param args - @defaultNested {<npmd:@comunica/bus-http/^4.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus>} bus
13
14
  */
14
15
  constructor(args: IActionObserverHttpArgs);
15
- onRun(_actor: Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>, _action: IActionHttp, _output: Promise<IActorHttpOutput>): void;
16
+ onRun(actor: Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>, _action: IActionHttp, _output: Promise<IActorHttpOutput>): void;
16
17
  }
17
18
  export interface IActionObserverHttpArgs extends IActionObserverArgs<IActionHttp, IActorHttpOutput> {
18
19
  /**
@@ -20,4 +21,9 @@ export interface IActionObserverHttpArgs extends IActionObserverArgs<IActionHttp
20
21
  * @default {<default_invalidator> a <npmd:@comunica/bus-http-invalidate/^4.0.0/components/ActorHttpInvalidateListenable.jsonld#ActorHttpInvalidateListenable>}
21
22
  */
22
23
  httpInvalidator: ActorHttpInvalidateListenable;
24
+ /**
25
+ * The URIs of the observed actors.
26
+ * @default {urn:comunica:default:http/actors#fetch}
27
+ */
28
+ observedActors: string[];
23
29
  }
@@ -19,8 +19,10 @@ class ActionObserverHttp extends core_1.ActionObserver {
19
19
  });
20
20
  }
21
21
  /* eslint-enable max-len */
22
- onRun(_actor, _action, _output) {
23
- this.requests++;
22
+ onRun(actor, _action, _output) {
23
+ if (this.observedActors.includes(actor.name)) {
24
+ this.requests++;
25
+ }
24
26
  }
25
27
  }
26
28
  exports.ActionObserverHttp = ActionObserverHttp;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionObserverHttp.js","sourceRoot":"","sources":["ActionObserverHttp.ts"],"names":[],"mappings":";;;AAGA,yCAAgD;AAEhD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,qBAA6C;IAInF,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,MAAmE,EACnE,OAAoB,EACpB,OAAkC;QAElC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;CACF;AAxBD,gDAwBC","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 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 this.requests++;\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"]}
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"]}
File without changes
File without changes
File without changes
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.1.0",
3
+ "version": "4.4.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.1.0",
45
- "@comunica/bus-http-invalidate": "^4.1.0",
46
- "@comunica/bus-query-result-serialize": "^4.1.0",
47
- "@comunica/context-entries": "^4.1.0",
48
- "@comunica/core": "^4.1.0",
49
- "@comunica/types": "^4.1.0",
44
+ "@comunica/bus-http": "^4.4.0",
45
+ "@comunica/bus-http-invalidate": "^4.4.0",
46
+ "@comunica/bus-query-result-serialize": "^4.4.0",
47
+ "@comunica/context-entries": "^4.4.0",
48
+ "@comunica/core": "^4.4.0",
49
+ "@comunica/types": "^4.4.0",
50
50
  "asynciterator": "^3.9.0",
51
51
  "readable-stream": "^4.5.2"
52
52
  },
53
- "gitHead": "711446473d18f5fd47aa1a67e6c23582234221ec"
53
+ "gitHead": "27acde56dfe0c1ff1162c1f46818ad752296ca88"
54
54
  }