jinaga-server 2.0.1 → 2.1.1
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 +12 -1
- package/dist/authentication/authentication-device.d.ts +3 -16
- package/dist/authentication/authentication-device.js +3 -40
- package/dist/authentication/authentication-device.js.map +1 -1
- package/dist/authentication/authentication-session.d.ts +3 -15
- package/dist/authentication/authentication-session.js +2 -37
- package/dist/authentication/authentication-session.js.map +1 -1
- package/dist/authorization/authorization-keystore.d.ts +2 -2
- package/dist/authorization/authorization-keystore.js.map +1 -1
- package/dist/jinaga-server.d.ts +2 -1
- package/dist/jinaga-server.js +38 -20
- package/dist/jinaga-server.js.map +1 -1
- package/dist/postgres/postgres-store.d.ts +2 -0
- package/dist/postgres/postgres-store.js +6 -0
- package/dist/postgres/postgres-store.js.map +1 -1
- package/package.json +2 -2
- package/src/authentication/authentication-device.ts +3 -65
- package/src/authentication/authentication-session.ts +4 -66
- package/src/authorization/authorization-keystore.ts +2 -2
- package/src/jinaga-server.ts +47 -22
- package/src/postgres/postgres-store.ts +8 -0
- package/test/authorization/authorizationSpec.ts +3 -5
- package/dist/authentication/authentication-impl.d.ts +0 -23
- package/dist/authentication/authentication-impl.js +0 -70
- package/dist/authentication/authentication-impl.js.map +0 -1
- package/dist/authentication/authentication-noop.d.ts +0 -20
- package/dist/authentication/authentication-noop.js +0 -52
- package/dist/authentication/authentication-noop.js.map +0 -1
- package/dist/authentication/authentication.d.ts +0 -5
- package/dist/authentication/authentication.js +0 -3
- package/dist/authentication/authentication.js.map +0 -1
- package/dist/authentication.d.ts +0 -19
- package/dist/authentication.js +0 -61
- package/dist/authentication.js.map +0 -1
- package/src/authentication/authentication-impl.ts +0 -69
- package/src/authentication/authentication-noop.ts +0 -65
- package/src/authentication/authentication.ts +0 -6
- package/src/authentication.ts +0 -68
package/dist/authentication.js
DELETED
|
@@ -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;AAFD,8BAEC;AAED,MAAa,cAAc;IACvB,YAAoB,KAAuB,EAAU,MAAiB;QAAlD,UAAK,GAAL,KAAK,CAAkB;QAAU,WAAM,GAAN,MAAM,CAAW;IACtE,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;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,sDAAsD,CAAC,CAAC;IAC5E,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;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
|
-
}
|
package/src/authentication.ts
DELETED
|
@@ -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
|
-
}
|