jinaga-server 2.0.1 → 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 (36) 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/package.json +2 -2
  15. package/src/authentication/authentication-device.ts +3 -65
  16. package/src/authentication/authentication-session.ts +4 -66
  17. package/src/authorization/authorization-keystore.ts +2 -2
  18. package/src/jinaga-server.ts +44 -21
  19. package/src/postgres/postgres-store.ts +8 -0
  20. package/test/authorization/authorizationSpec.ts +2 -4
  21. package/dist/authentication/authentication-impl.d.ts +0 -23
  22. package/dist/authentication/authentication-impl.js +0 -70
  23. package/dist/authentication/authentication-impl.js.map +0 -1
  24. package/dist/authentication/authentication-noop.d.ts +0 -20
  25. package/dist/authentication/authentication-noop.js +0 -52
  26. package/dist/authentication/authentication-noop.js.map +0 -1
  27. package/dist/authentication/authentication.d.ts +0 -5
  28. package/dist/authentication/authentication.js +0 -3
  29. package/dist/authentication/authentication.js.map +0 -1
  30. package/dist/authentication.d.ts +0 -19
  31. package/dist/authentication.js +0 -61
  32. package/dist/authentication.js.map +0 -1
  33. package/src/authentication/authentication-impl.ts +0 -69
  34. package/src/authentication/authentication-noop.ts +0 -65
  35. package/src/authentication/authentication.ts +0 -6
  36. package/src/authentication.ts +0 -68
@@ -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
- }