prostgles-server 2.0.164 → 2.0.167
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/dist/DboBuilder.d.ts.map +1 -1
- package/dist/DboBuilder.js +19 -12
- package/dist/DboBuilder.js.map +1 -1
- package/examples/full-example-typescript/index.ts +13 -33
- package/examples/full-example-typescript/package-lock.json +5423 -0
- package/examples/full-example-typescript/package.json +4 -7
- package/examples/full-example-vanilla/index.js +3 -52
- package/examples/full-example-vanilla/package.json +5 -5
- package/examples/server/javascript/index.js +1 -1
- package/examples/server/javascript/package.json +3 -3
- package/examples/server/typescript/index.ts +2 -3
- package/examples/server/typescript/package-lock.json +5406 -0
- package/examples/server/typescript/package.json +3 -4
- package/lib/DboBuilder.ts +23 -14
- package/package.json +1 -1
- package/tests/client/PID.txt +1 -1
- package/tests/server/package-lock.json +1 -1
- package/examples/client/react-typescript/README.md +0 -44
- package/examples/client/react-typescript/package-lock.json +0 -13909
- package/examples/client/react-typescript/package.json +0 -39
- package/examples/client/react-typescript/public/favicon.ico +0 -0
- package/examples/client/react-typescript/public/index.html +0 -43
- package/examples/client/react-typescript/public/logo192.png +0 -0
- package/examples/client/react-typescript/public/logo512.png +0 -0
- package/examples/client/react-typescript/public/manifest.json +0 -25
- package/examples/client/react-typescript/public/robots.txt +0 -3
- package/examples/client/react-typescript/src/App.css +0 -38
- package/examples/client/react-typescript/src/App.test.tsx +0 -9
- package/examples/client/react-typescript/src/App.tsx +0 -26
- package/examples/client/react-typescript/src/index.css +0 -13
- package/examples/client/react-typescript/src/index.tsx +0 -17
- package/examples/client/react-typescript/src/logo.svg +0 -7
- package/examples/client/react-typescript/src/react-app-env.d.ts +0 -1
- package/examples/client/react-typescript/src/serviceWorker.ts +0 -149
- package/examples/client/react-typescript/src/setupTests.ts +0 -5
- package/examples/client/react-typescript/tsconfig.json +0 -25
- package/examples/client/vanilla-js/index.html +0 -21
- package/examples/full-example-react/client/README.md +0 -68
- package/examples/full-example-react/client/package-lock.json +0 -14134
- package/examples/full-example-react/client/package.json +0 -36
- package/examples/full-example-react/client/public/favicon.ico +0 -0
- package/examples/full-example-react/client/public/index.html +0 -43
- package/examples/full-example-react/client/public/logo192.png +0 -0
- package/examples/full-example-react/client/public/logo512.png +0 -0
- package/examples/full-example-react/client/public/manifest.json +0 -25
- package/examples/full-example-react/client/public/robots.txt +0 -3
- package/examples/full-example-react/client/src/App.css +0 -14
- package/examples/full-example-react/client/src/App.js +0 -58
- package/examples/full-example-react/client/src/App.test.js +0 -9
- package/examples/full-example-react/client/src/index.css +0 -13
- package/examples/full-example-react/client/src/index.js +0 -17
- package/examples/full-example-react/client/src/logo.svg +0 -7
- package/examples/full-example-react/client/src/serviceWorker.js +0 -141
- package/examples/full-example-react/client/src/setupTests.js +0 -5
- package/examples/full-example-react/client/src/sssetupProxy.js +0 -6
- package/examples/full-example-react/server/index.js +0 -42
- package/examples/full-example-react/server/init.sql +0 -7
- package/examples/full-example-react/server/package.json +0 -18
- package/examples/full-example-typescript/package copy.json +0 -16
|
@@ -8,12 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"express": "
|
|
12
|
-
"prostgles-client": "
|
|
13
|
-
"prostgles-server": "
|
|
14
|
-
"socket.io": "^4.
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@types/socket.io": "^2.1.12"
|
|
11
|
+
"express": "latest",
|
|
12
|
+
"prostgles-client": "latest",
|
|
13
|
+
"prostgles-server": "latest",
|
|
14
|
+
"socket.io": "^4.5.1"
|
|
18
15
|
}
|
|
19
16
|
}
|
|
@@ -5,8 +5,7 @@ var http = require('http').createServer(app);
|
|
|
5
5
|
var io = require('socket.io')(http, { path: "/s" });
|
|
6
6
|
http.listen(3001);
|
|
7
7
|
|
|
8
|
-
let prostgles = require('
|
|
9
|
-
// let prostgles = require('prostgles-server');
|
|
8
|
+
let prostgles = require('prostgles-server');
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
prostgles({
|
|
@@ -25,32 +24,14 @@ prostgles({
|
|
|
25
24
|
|
|
26
25
|
io,
|
|
27
26
|
|
|
28
|
-
onReady: async (
|
|
29
|
-
try {
|
|
30
|
-
// dbo.Events.subscribe({}, {}, console.log)
|
|
31
|
-
// setTimeout(async ()=>{
|
|
32
|
-
// try {
|
|
33
|
-
// await dbo.Events.insert({ Id: 1 });
|
|
34
|
-
// await dbo.Events.insert({ Id: 21 });
|
|
35
|
-
// await dbo.Events.update({ Id: { $lt: 4 }}, { Id: 12 });
|
|
36
|
-
// await dbo.Events.delete({});
|
|
37
|
-
|
|
38
|
-
// } catch(err) {
|
|
39
|
-
// console.error(err)
|
|
40
|
-
// }
|
|
41
|
-
// }, 1000);
|
|
42
|
-
|
|
43
|
-
} catch(err) {
|
|
44
|
-
console.error(err)
|
|
45
|
-
}
|
|
46
|
-
|
|
27
|
+
onReady: async () => {
|
|
47
28
|
app.get('*', function(req, res){
|
|
48
29
|
console.log(req.originalUrl)
|
|
49
30
|
res.sendFile(path.join(__dirname+'/home.html'));
|
|
50
31
|
});
|
|
51
32
|
},
|
|
52
33
|
|
|
53
|
-
publish: (
|
|
34
|
+
publish: () => {
|
|
54
35
|
return {
|
|
55
36
|
|
|
56
37
|
Points: {
|
|
@@ -75,34 +56,4 @@ prostgles({
|
|
|
75
56
|
}
|
|
76
57
|
}
|
|
77
58
|
},
|
|
78
|
-
|
|
79
|
-
// publishMethods: ( socket, dbo) => {
|
|
80
|
-
|
|
81
|
-
// return {
|
|
82
|
-
// upload: async (data) => {
|
|
83
|
-
// // let tl = Date.now();
|
|
84
|
-
// //let res = await dbo.pixels.insert(data);
|
|
85
|
-
// // console.log(Date.now() - tl, "ms");
|
|
86
|
-
// console.log(data)// res;
|
|
87
|
-
// dbo.pixels.insert({ blb: data })
|
|
88
|
-
// }
|
|
89
|
-
// }
|
|
90
|
-
// },
|
|
91
|
-
// onSocketConnect: async ({ socket, dbo }) => {
|
|
92
|
-
// /* Sending file */
|
|
93
|
-
// fs.readFile('home.html', function(err, buf){
|
|
94
|
-
// socket.emit('home', { image: true, buffer: buf });
|
|
95
|
-
// });
|
|
96
|
-
|
|
97
|
-
// return true;
|
|
98
|
-
// },
|
|
99
|
-
// onSocketDisconnect: async ({ socket, dbo }) => {
|
|
100
|
-
// return true;
|
|
101
|
-
// },
|
|
102
|
-
// auth: {
|
|
103
|
-
// login: (data, { socket, dbo }) => {},
|
|
104
|
-
// register: (data, { socket, dbo }) => {},
|
|
105
|
-
// logout: (data, { socket, dbo }) => {},
|
|
106
|
-
// onChange: (state, { socket, dbo }) => {},
|
|
107
|
-
// },
|
|
108
59
|
});
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"bluebird": "
|
|
13
|
-
"express": "
|
|
14
|
-
"mongodb": "
|
|
15
|
-
"prostgles-server": "
|
|
16
|
-
"socket.io": "
|
|
12
|
+
"bluebird": "latest",
|
|
13
|
+
"express": "latest",
|
|
14
|
+
"mongodb": "latest",
|
|
15
|
+
"prostgles-server": "latest",
|
|
16
|
+
"socket.io": "latest"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import express from 'express';
|
|
3
|
-
|
|
4
|
-
import prostgles from "../../../dist/index";
|
|
3
|
+
import prostgles from "prostgles-server";
|
|
5
4
|
const app = express();
|
|
6
5
|
const http = require('http').createServer(app);
|
|
7
6
|
const io = require("socket.io")(http);
|
|
@@ -21,7 +20,7 @@ prostgles({
|
|
|
21
20
|
io,
|
|
22
21
|
tsGeneratedTypesDir: path.join(__dirname + '/'),
|
|
23
22
|
transactions: "tt",
|
|
24
|
-
publish: (
|
|
23
|
+
publish: () => {
|
|
25
24
|
|
|
26
25
|
return "*";
|
|
27
26
|
},
|