jinaga-server 1.1.4 → 2.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 +12 -0
- package/dist/authentication/authentication-device.d.ts +3 -2
- package/dist/authentication/authentication-device.js +6 -0
- package/dist/authentication/authentication-device.js.map +1 -1
- package/dist/authentication/authentication-impl.d.ts +3 -2
- package/dist/authentication/authentication-impl.js +6 -0
- package/dist/authentication/authentication-impl.js.map +1 -1
- package/dist/authentication/authentication-noop.d.ts +20 -0
- package/dist/authentication/authentication-noop.js +52 -0
- package/dist/authentication/authentication-noop.js.map +1 -0
- package/dist/authentication/authentication-session.d.ts +3 -2
- package/dist/authentication/authentication-session.js +6 -0
- package/dist/authentication/authentication-session.js.map +1 -1
- package/dist/authentication.d.ts +3 -2
- package/dist/authentication.js +6 -0
- package/dist/authentication.js.map +1 -1
- package/dist/authorization/authorization-keystore.d.ts +3 -4
- package/dist/authorization/authorization-keystore.js +9 -4
- package/dist/authorization/authorization-keystore.js.map +1 -1
- package/dist/debug.d.ts +1 -0
- package/dist/debug.js +30 -0
- package/dist/debug.js.map +1 -0
- package/dist/http/router.js.map +1 -1
- package/dist/jinaga-server.js +15 -7
- package/dist/jinaga-server.js.map +1 -1
- package/dist/memory/memory-keystore.js +0 -6
- package/dist/memory/memory-keystore.js.map +1 -1
- package/dist/postgres/connection.js +1 -0
- package/dist/postgres/connection.js.map +1 -1
- package/dist/postgres/maps.d.ts +7 -6
- package/dist/postgres/maps.js +9 -1
- package/dist/postgres/maps.js.map +1 -1
- package/dist/postgres/postgres-keystore.js +0 -6
- package/dist/postgres/postgres-keystore.js.map +1 -1
- package/dist/postgres/postgres-store.d.ts +1 -2
- package/dist/postgres/postgres-store.js +29 -24
- package/dist/postgres/postgres-store.js.map +1 -1
- package/dist/postgres/specification-result-sql.d.ts +4 -4
- package/dist/postgres/specification-result-sql.js +34 -24
- package/dist/postgres/specification-result-sql.js.map +1 -1
- package/dist/postgres/specification-sql.js.map +1 -1
- package/dist/postgres/sql.d.ts +1 -1
- package/dist/postgres/sql.js +15 -7
- package/dist/postgres/sql.js.map +1 -1
- package/dist/util/maps.d.ts +0 -0
- package/dist/util/maps.js +2 -0
- package/dist/util/maps.js.map +1 -0
- package/docs/sql/SQL Generator (projection).png +0 -0
- package/docs/sql/SQLFromSpecification.md +2 -0
- package/integration-test/jinaga-test/Dockerfile +2 -2
- package/integration-test/jinaga-test/jinaga.test.js +3 -3
- package/integration-test/jinaga-test/package-lock.json +745 -3484
- package/integration-test/jinaga-test/package.json +2 -0
- package/integration-test/run.sh +3 -3
- package/package.json +5 -6
- package/replicator/index.ts +31 -0
- package/replicator/package-lock.json +855 -0
- package/replicator/package.json +27 -0
- package/replicator/tsconfig.json +15 -0
- package/src/authentication/authentication-device.ts +11 -1
- package/src/authentication/authentication-impl.ts +9 -2
- package/src/authentication/authentication-noop.ts +65 -0
- package/src/authentication/authentication-session.ts +11 -1
- package/src/authentication.ts +12 -2
- package/src/authorization/authorization-keystore.ts +12 -7
- package/src/debug.ts +30 -0
- package/src/http/router.ts +2 -2
- package/src/jinaga-server.ts +18 -8
- package/src/memory/memory-keystore.ts +0 -6
- package/src/postgres/connection.ts +2 -1
- package/src/postgres/maps.ts +8 -0
- package/src/postgres/postgres-keystore.ts +2 -8
- package/src/postgres/postgres-store.ts +37 -30
- package/src/postgres/specification-result-sql.ts +56 -45
- package/src/postgres/specification-sql.ts +1 -1
- package/src/postgres/sql.ts +23 -12
- package/src/util/maps.ts +0 -0
- package/test/postgres/postgresReadSpec.ts +4 -1
- package/test/postgres/postgresSpec.ts +31 -31
- package/test/postgres/postgresSpecificationSpec.ts +1 -1
- package/tsconfig.json +1 -0
- package/tsconfig.test.json +26 -0
- package/docs/specification.txt +0 -41
- package/interactive/index.js +0 -56
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
"author": "Michael L Perry",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"@stablelib/base64": "^1.0.1",
|
|
16
17
|
"express": "^4.17.2",
|
|
17
18
|
"jest": "^28.1.0",
|
|
18
19
|
"jest-compact-reporter": "^1.2.9",
|
|
20
|
+
"jinaga": "^5.0.0",
|
|
19
21
|
"node-forge": "^1.3.0",
|
|
20
22
|
"passport": "^0.5.2",
|
|
21
23
|
"pg": "^8.7.1",
|
package/integration-test/run.sh
CHANGED
|
@@ -3,9 +3,9 @@ set -e
|
|
|
3
3
|
|
|
4
4
|
docker build -t jinaga-postgres-fact-keystore ./postgres
|
|
5
5
|
|
|
6
|
-
mkdir -p ./jinaga-test/jinaga
|
|
7
|
-
cp -R ../dist ./jinaga-test/jinaga/dist
|
|
8
|
-
cp ../package.json ./jinaga-test/jinaga/package.json
|
|
6
|
+
mkdir -p ./jinaga-test/jinaga-server
|
|
7
|
+
cp -R ../dist ./jinaga-test/jinaga-server/dist
|
|
8
|
+
cp ../package.json ./jinaga-test/jinaga-server/package.json
|
|
9
9
|
docker build -t jinaga-test ./jinaga-test
|
|
10
10
|
|
|
11
11
|
cleanup() {
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jinaga-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Application-agnostic back end for web applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"clean": "rimraf dist/ && rimraf integration-test/jinaga-test/jinaga/ && rimraf integration-test/jinaga-test/node_modules/",
|
|
9
9
|
"build": "tsc",
|
|
10
|
-
"test": "jest",
|
|
10
|
+
"test": "tsc --noEmit --project tsconfig.test.json && jest",
|
|
11
11
|
"test:watch": "jest --watch",
|
|
12
|
+
"debug": "node ./dist/debug.js",
|
|
12
13
|
"prepublishOnly": "npm run clean && npm run build && npm run test",
|
|
13
|
-
"integration": "npm run build && cd ./integration-test && ./run.sh"
|
|
14
|
-
"interactive": "nodemon -w docs/specification.txt -x \"cat docs/specification.txt | node interactive\"",
|
|
15
|
-
"interactive:results": "nodemon -w docs/specification.txt -x \"cat docs/specification.txt | node interactive --results\""
|
|
14
|
+
"integration": "npm run build && cd ./integration-test && ./run.sh"
|
|
16
15
|
},
|
|
17
16
|
"repository": {
|
|
18
17
|
"type": "git",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
},
|
|
44
43
|
"dependencies": {
|
|
45
44
|
"express": "^4.18.1",
|
|
46
|
-
"jinaga": "^
|
|
45
|
+
"jinaga": "^5.0.1",
|
|
47
46
|
"node-forge": "^1.3.1",
|
|
48
47
|
"passport": "^0.6.0",
|
|
49
48
|
"pg": "^8.7.1"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import cors = require("cors");
|
|
2
|
+
import express = require("express");
|
|
3
|
+
import * as http from "http";
|
|
4
|
+
import { JinagaServer } from "../src";
|
|
5
|
+
import process = require("process");
|
|
6
|
+
|
|
7
|
+
process.on('SIGINT', () => {
|
|
8
|
+
console.log("\n\nStopping replicator\n");
|
|
9
|
+
process.exit(0);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const app = express();
|
|
13
|
+
const server = http.createServer(app);
|
|
14
|
+
|
|
15
|
+
app.set('port', process.env.PORT || 8080);
|
|
16
|
+
app.use(express.json());
|
|
17
|
+
app.use(express.text());
|
|
18
|
+
app.use(cors());
|
|
19
|
+
|
|
20
|
+
const pgConnection = process.env.JINAGA_POSTGRESQL ||
|
|
21
|
+
'postgresql://dev:devpw@localhost:5432/replicator';
|
|
22
|
+
const { handler } = JinagaServer.create({
|
|
23
|
+
pgStore: pgConnection
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
app.use('/jinaga', handler);
|
|
27
|
+
|
|
28
|
+
server.listen(app.get('port'), () => {
|
|
29
|
+
console.log(` Replicator is running at http://localhost:${app.get('port')} in ${app.get('env')} mode`);
|
|
30
|
+
console.log(' Press CTRL-C to stop\n');
|
|
31
|
+
});
|