jinaga-server 2.0.0 → 2.1.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.
Files changed (40) hide show
  1. package/dist/authentication/authentication-device.d.ts +3 -16
  2. package/dist/authentication/authentication-device.js +3 -40
  3. package/dist/authentication/authentication-device.js.map +1 -1
  4. package/dist/authentication/authentication-session.d.ts +3 -15
  5. package/dist/authentication/authentication-session.js +2 -37
  6. package/dist/authentication/authentication-session.js.map +1 -1
  7. package/dist/authorization/authorization-keystore.d.ts +2 -2
  8. package/dist/authorization/authorization-keystore.js.map +1 -1
  9. package/dist/jinaga-server.js +37 -19
  10. package/dist/jinaga-server.js.map +1 -1
  11. package/dist/postgres/postgres-store.d.ts +2 -0
  12. package/dist/postgres/postgres-store.js +6 -0
  13. package/dist/postgres/postgres-store.js.map +1 -1
  14. package/dist/postgres/specification-result-sql.d.ts +2 -0
  15. package/dist/postgres/specification-result-sql.js +31 -1
  16. package/dist/postgres/specification-result-sql.js.map +1 -1
  17. package/package.json +4 -3
  18. package/src/authentication/authentication-device.ts +3 -65
  19. package/src/authentication/authentication-session.ts +4 -66
  20. package/src/authorization/authorization-keystore.ts +2 -2
  21. package/src/jinaga-server.ts +44 -21
  22. package/src/postgres/postgres-store.ts +8 -0
  23. package/src/postgres/specification-result-sql.ts +35 -1
  24. package/test/authorization/authorizationSpec.ts +2 -4
  25. package/dist/authentication/authentication-impl.d.ts +0 -23
  26. package/dist/authentication/authentication-impl.js +0 -70
  27. package/dist/authentication/authentication-impl.js.map +0 -1
  28. package/dist/authentication/authentication-noop.d.ts +0 -20
  29. package/dist/authentication/authentication-noop.js +0 -52
  30. package/dist/authentication/authentication-noop.js.map +0 -1
  31. package/dist/authentication/authentication.d.ts +0 -5
  32. package/dist/authentication/authentication.js +0 -3
  33. package/dist/authentication/authentication.js.map +0 -1
  34. package/dist/authentication.d.ts +0 -19
  35. package/dist/authentication.js +0 -61
  36. package/dist/authentication.js.map +0 -1
  37. package/src/authentication/authentication-impl.ts +0 -69
  38. package/src/authentication/authentication-noop.ts +0 -65
  39. package/src/authentication/authentication.ts +0 -6
  40. package/src/authentication.ts +0 -68
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AuthenticationImpl = exports.Principal = void 0;
13
- class Principal {
14
- }
15
- exports.Principal = Principal;
16
- class AuthenticationImpl {
17
- constructor(inner, client) {
18
- this.inner = inner;
19
- this.client = client;
20
- }
21
- close() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- yield this.inner.close();
24
- });
25
- }
26
- login() {
27
- return this.client.login();
28
- }
29
- local() {
30
- throw new Error('Local device has no persistence.');
31
- }
32
- save(envelopes) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const saved = yield this.inner.save(envelopes);
35
- return saved;
36
- });
37
- }
38
- query(start, query) {
39
- return this.inner.query(start, query);
40
- }
41
- read(start, specification) {
42
- return this.inner.read(start, specification);
43
- }
44
- feed(feed, bookmark) {
45
- return this.inner.feed(feed, bookmark);
46
- }
47
- whichExist(references) {
48
- throw new Error("whichExist method not implemented on AuthenticationImpl.");
49
- }
50
- load(references) {
51
- return this.inner.load(references);
52
- }
53
- from(fact, query) {
54
- return this.inner.from(fact, query);
55
- }
56
- addSpecificationListener(specification, onResult) {
57
- return this.inner.addSpecificationListener(specification, onResult);
58
- }
59
- removeSpecificationListener(listener) {
60
- this.inner.removeSpecificationListener(listener);
61
- }
62
- addChannel(fact, query) {
63
- return this.inner.addChannel(fact, query);
64
- }
65
- removeChannel(channel) {
66
- this.inner.removeChannel(channel);
67
- }
68
- }
69
- exports.AuthenticationImpl = AuthenticationImpl;
70
- //# sourceMappingURL=authentication-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication-impl.js","sourceRoot":"","sources":["../../src/authentication/authentication-impl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,SAAS;CAErB;AAFD,8BAEC;AAED,MAAa,kBAAkB;IAC3B,YAAoB,KAAW,EAAU,MAAiB;QAAtC,UAAK,GAAL,KAAK,CAAM;QAAU,WAAM,GAAN,MAAM,CAAW;IAC1D,CAAC;IAEK,KAAK;;YACP,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC7B,CAAC;KAAA;IAED,KAAK;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK;QACD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;IAEK,IAAI,CAAC,SAAyB;;YAChC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC/C,OAAO,KAAK,CAAC;QACjB,CAAC;KAAA;IAED,KAAK,CAAC,KAAoB,EAAE,KAAY;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC,KAAsB,EAAE,aAA4B;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC,IAAU,EAAE,QAAgB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,UAAU,CAAC,UAA2B;QAClC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,CAAC,UAA2B;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,IAAmB,EAAE,KAAY;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,wBAAwB,CAAC,aAA4B,EAAE,QAAuD;QAC1G,OAAO,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxE,CAAC;IAED,2BAA2B,CAAC,QAA+B;QACvD,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC;IAED,UAAU,CAAC,IAAmB,EAAE,KAAY;QACxC,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,aAAa,CAAC,OAAgB;QAC1B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AA5DD,gDA4DC"}
@@ -1,20 +0,0 @@
1
- import { Channel, FactEnvelope, FactFeed, FactPath, FactRecord, FactReference, Feed, LoginResponse, Observable, ObservableSource, ProjectedResult, Query, Specification, SpecificationListener } from "jinaga";
2
- import { Authentication } from "./authentication";
3
- export declare class AuthenticationNoOp implements Authentication {
4
- private inner;
5
- constructor(inner: ObservableSource);
6
- login(): Promise<LoginResponse>;
7
- local(): Promise<FactRecord>;
8
- addChannel(fact: FactReference, query: Query): Channel;
9
- removeChannel(channel: Channel): void;
10
- from(fact: FactReference, query: Query): Observable;
11
- addSpecificationListener(specification: Specification, onResult: (results: ProjectedResult[]) => Promise<void>): SpecificationListener;
12
- removeSpecificationListener(listener: SpecificationListener): void;
13
- close(): Promise<void>;
14
- save(envelopes: FactEnvelope[]): Promise<FactEnvelope[]>;
15
- query(start: FactReference, query: Query): Promise<FactPath[]>;
16
- read(start: FactReference[], specification: Specification): Promise<ProjectedResult[]>;
17
- feed(feed: Feed, bookmark: string): Promise<FactFeed>;
18
- whichExist(references: FactReference[]): Promise<FactReference[]>;
19
- load(references: FactReference[]): Promise<FactRecord[]>;
20
- }
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthenticationNoOp = void 0;
4
- class AuthenticationNoOp {
5
- constructor(inner) {
6
- this.inner = inner;
7
- }
8
- login() {
9
- throw new Error("No keystore is configured.");
10
- }
11
- local() {
12
- throw new Error("No keystore is configured.");
13
- }
14
- addChannel(fact, query) {
15
- throw new Error("No keystore is configured.");
16
- }
17
- removeChannel(channel) {
18
- throw new Error("No keystore is configured.");
19
- }
20
- from(fact, query) {
21
- return this.inner.from(fact, query);
22
- }
23
- addSpecificationListener(specification, onResult) {
24
- return this.inner.addSpecificationListener(specification, onResult);
25
- }
26
- removeSpecificationListener(listener) {
27
- return this.inner.removeSpecificationListener(listener);
28
- }
29
- close() {
30
- return this.inner.close();
31
- }
32
- save(envelopes) {
33
- return this.inner.save(envelopes);
34
- }
35
- query(start, query) {
36
- return this.inner.query(start, query);
37
- }
38
- read(start, specification) {
39
- return this.inner.read(start, specification);
40
- }
41
- feed(feed, bookmark) {
42
- return this.inner.feed(feed, bookmark);
43
- }
44
- whichExist(references) {
45
- return this.inner.whichExist(references);
46
- }
47
- load(references) {
48
- return this.inner.load(references);
49
- }
50
- }
51
- exports.AuthenticationNoOp = AuthenticationNoOp;
52
- //# sourceMappingURL=authentication-noop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication-noop.js","sourceRoot":"","sources":["../../src/authentication/authentication-noop.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;IAE3B,YACY,KAAuB;QAAvB,UAAK,GAAL,KAAK,CA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AI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,UAAU,CAAC,UAA2B;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC,UAA2B;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;CACJ;AA7DD,gDA6DC"}
@@ -1,5 +0,0 @@
1
- import { FactRecord, Fork, LoginResponse } from "jinaga";
2
- export interface Authentication extends Fork {
3
- login(): Promise<LoginResponse>;
4
- local(): Promise<FactRecord>;
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=authentication.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../src/authentication/authentication.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- import { FactEnvelope, FactFeed, FactRecord, FactReference, Feed, Observable, ObservableSource, ProjectedResult, Query, Specification, SpecificationListener, WebClient } from "jinaga";
2
- export declare class Principal {
3
- }
4
- export declare class Authentication implements ObservableSource {
5
- private inner;
6
- private client;
7
- constructor(inner: ObservableSource, client: WebClient);
8
- close(): Promise<void>;
9
- login(): Promise<import("jinaga").LoginResponse>;
10
- save(envelopes: FactEnvelope[]): Promise<FactEnvelope[]>;
11
- query(start: FactReference, query: Query): Promise<import("jinaga").FactPath[]>;
12
- read(start: FactReference[], specification: Specification): Promise<any[]>;
13
- feed(feed: Feed, bookmark: string): Promise<FactFeed>;
14
- whichExist(references: FactReference[]): Promise<FactReference[]>;
15
- load(references: FactReference[]): Promise<FactRecord[]>;
16
- from(fact: FactReference, query: Query): Observable;
17
- addSpecificationListener(specification: Specification, onResult: (results: ProjectedResult[]) => Promise<void>): SpecificationListener;
18
- removeSpecificationListener(listener: SpecificationListener): void;
19
- }
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Authentication = exports.Principal = void 0;
13
- class Principal {
14
- }
15
- exports.Principal = Principal;
16
- class Authentication {
17
- constructor(inner, client) {
18
- this.inner = inner;
19
- this.client = client;
20
- }
21
- close() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- yield this.inner.close();
24
- });
25
- }
26
- login() {
27
- return this.client.login();
28
- }
29
- save(envelopes) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- const saved = yield this.inner.save(envelopes);
32
- return saved;
33
- });
34
- }
35
- query(start, query) {
36
- return this.inner.query(start, query);
37
- }
38
- read(start, specification) {
39
- return this.inner.read(start, specification);
40
- }
41
- feed(feed, bookmark) {
42
- return this.inner.feed(feed, bookmark);
43
- }
44
- whichExist(references) {
45
- throw new Error("whichExist method not implemented on Authentication.");
46
- }
47
- load(references) {
48
- return this.inner.load(references);
49
- }
50
- from(fact, query) {
51
- return this.inner.from(fact, query);
52
- }
53
- addSpecificationListener(specification, onResult) {
54
- return this.inner.addSpecificationListener(specification, onResult);
55
- }
56
- removeSpecificationListener(listener) {
57
- this.inner.removeSpecificationListener(listener);
58
- }
59
- }
60
- exports.Authentication = Authentication;
61
- //# sourceMappingURL=authentication.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication.js","sourceRoot":"","sources":["../src/authentication.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,MAAa,SAAS;CAErB;AAF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BAAwB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxE,CAAC;IAED,2BAA2B,CAAC,QAA+B;QACvD,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC;CACJ;AAhDD,wCAgDC"}
@@ -1,69 +0,0 @@
1
- import { Channel, FactEnvelope, FactFeed, FactRecord, FactReference, Feed, Fork, Observable, ProjectedResult, Query, Specification, SpecificationListener, WebClient } from "jinaga";
2
-
3
- import { Authentication } from "./authentication";
4
-
5
- export class Principal {
6
-
7
- }
8
-
9
- export class AuthenticationImpl implements Authentication {
10
- constructor(private inner: Fork, private client: WebClient) {
11
- }
12
-
13
- async close(): Promise<void> {
14
- await this.inner.close();
15
- }
16
-
17
- login() {
18
- return this.client.login();
19
- }
20
-
21
- local(): Promise<FactRecord> {
22
- throw new Error('Local device has no persistence.');
23
- }
24
-
25
- async save(envelopes: FactEnvelope[]): Promise<FactEnvelope[]> {
26
- const saved = await this.inner.save(envelopes);
27
- return saved;
28
- }
29
-
30
- query(start: FactReference, query: Query) {
31
- return this.inner.query(start, query);
32
- }
33
-
34
- read(start: FactReference[], specification: Specification): Promise<any[]> {
35
- return this.inner.read(start, specification);
36
- }
37
-
38
- feed(feed: Feed, bookmark: string): Promise<FactFeed> {
39
- return this.inner.feed(feed, bookmark);
40
- }
41
-
42
- whichExist(references: FactReference[]): Promise<FactReference[]> {
43
- throw new Error("whichExist method not implemented on AuthenticationImpl.");
44
- }
45
-
46
- load(references: FactReference[]): Promise<FactRecord[]> {
47
- return this.inner.load(references);
48
- }
49
-
50
- from(fact: FactReference, query: Query): Observable {
51
- return this.inner.from(fact, query);
52
- }
53
-
54
- addSpecificationListener(specification: Specification, onResult: (results: ProjectedResult[]) => Promise<void>): SpecificationListener {
55
- return this.inner.addSpecificationListener(specification, onResult);
56
- }
57
-
58
- removeSpecificationListener(listener: SpecificationListener): void {
59
- this.inner.removeSpecificationListener(listener);
60
- }
61
-
62
- addChannel(fact: FactReference, query: Query): Channel {
63
- return this.inner.addChannel(fact, query);
64
- }
65
-
66
- removeChannel(channel: Channel) {
67
- this.inner.removeChannel(channel);
68
- }
69
- }
@@ -1,65 +0,0 @@
1
- import { Channel, FactEnvelope, FactFeed, FactPath, FactRecord, FactReference, Feed, Fork, LoginResponse, Observable, ObservableSource, ProjectedResult, Query, Specification, SpecificationListener } from "jinaga";
2
- import { Authentication } from "./authentication";
3
-
4
- export class AuthenticationNoOp implements Authentication {
5
-
6
- constructor(
7
- private inner: ObservableSource
8
- ) { }
9
-
10
- login(): Promise<LoginResponse> {
11
- throw new Error("No keystore is configured.");
12
- }
13
-
14
- local(): Promise<FactRecord> {
15
- throw new Error("No keystore is configured.");
16
- }
17
-
18
- addChannel(fact: FactReference, query: Query): Channel {
19
- throw new Error("No keystore is configured.");
20
- }
21
-
22
- removeChannel(channel: Channel): void {
23
- throw new Error("No keystore is configured.");
24
- }
25
-
26
- from(fact: FactReference, query: Query): Observable {
27
- return this.inner.from(fact, query);
28
- }
29
-
30
- addSpecificationListener(specification: Specification, onResult: (results: ProjectedResult[]) => Promise<void>): SpecificationListener {
31
- return this.inner.addSpecificationListener(specification, onResult);
32
- }
33
-
34
- removeSpecificationListener(listener: SpecificationListener): void {
35
- return this.inner.removeSpecificationListener(listener);
36
- }
37
-
38
- close(): Promise<void> {
39
- return this.inner.close();
40
- }
41
-
42
- save(envelopes: FactEnvelope[]): Promise<FactEnvelope[]> {
43
- return this.inner.save(envelopes);
44
- }
45
-
46
- query(start: FactReference, query: Query): Promise<FactPath[]> {
47
- return this.inner.query(start, query);
48
- }
49
-
50
- read(start: FactReference[], specification: Specification): Promise<ProjectedResult[]> {
51
- return this.inner.read(start, specification);
52
- }
53
-
54
- feed(feed: Feed, bookmark: string): Promise<FactFeed> {
55
- return this.inner.feed(feed, bookmark);
56
- }
57
-
58
- whichExist(references: FactReference[]): Promise<FactReference[]> {
59
- return this.inner.whichExist(references);
60
- }
61
-
62
- load(references: FactReference[]): Promise<FactRecord[]> {
63
- return this.inner.load(references);
64
- }
65
- }
@@ -1,6 +0,0 @@
1
- import { FactRecord, Fork, LoginResponse } from "jinaga";
2
-
3
- export interface Authentication extends Fork {
4
- login(): Promise<LoginResponse>;
5
- local(): Promise<FactRecord>;
6
- }
@@ -1,68 +0,0 @@
1
- import {
2
- FactEnvelope,
3
- FactFeed,
4
- FactRecord,
5
- FactReference,
6
- Feed,
7
- Observable,
8
- ObservableSource,
9
- ProjectedResult,
10
- Query,
11
- Specification,
12
- SpecificationListener,
13
- WebClient
14
- } from "jinaga";
15
-
16
- export class Principal {
17
-
18
- }
19
-
20
- export class Authentication implements ObservableSource {
21
- constructor(private inner: ObservableSource, private client: WebClient) {
22
- }
23
-
24
- async close(): Promise<void> {
25
- await this.inner.close();
26
- }
27
-
28
- login() {
29
- return this.client.login();
30
- }
31
-
32
- async save(envelopes: FactEnvelope[]): Promise<FactEnvelope[]> {
33
- const saved = await this.inner.save(envelopes);
34
- return saved;
35
- }
36
-
37
- query(start: FactReference, query: Query) {
38
- return this.inner.query(start, query);
39
- }
40
-
41
- read(start: FactReference[], specification: Specification): Promise<any[]> {
42
- return this.inner.read(start, specification);
43
- }
44
-
45
- feed(feed: Feed, bookmark: string): Promise<FactFeed> {
46
- return this.inner.feed(feed, bookmark);
47
- }
48
-
49
- whichExist(references: FactReference[]): Promise<FactReference[]> {
50
- throw new Error("whichExist method not implemented on Authentication.");
51
- }
52
-
53
- load(references: FactReference[]): Promise<FactRecord[]> {
54
- return this.inner.load(references);
55
- }
56
-
57
- from(fact: FactReference, query: Query): Observable {
58
- return this.inner.from(fact, query);
59
- }
60
-
61
- addSpecificationListener(specification: Specification, onResult: (results: ProjectedResult[]) => Promise<void>): SpecificationListener {
62
- return this.inner.addSpecificationListener(specification, onResult);
63
- }
64
-
65
- removeSpecificationListener(listener: SpecificationListener): void {
66
- this.inner.removeSpecificationListener(listener);
67
- }
68
- }