prostgles-server 2.0.166 → 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.
Files changed (53) hide show
  1. package/examples/full-example-typescript/index.ts +13 -33
  2. package/examples/full-example-typescript/package-lock.json +5423 -0
  3. package/examples/full-example-typescript/package.json +4 -7
  4. package/examples/full-example-vanilla/index.js +3 -52
  5. package/examples/full-example-vanilla/package.json +5 -5
  6. package/examples/server/javascript/index.js +1 -1
  7. package/examples/server/javascript/package.json +3 -3
  8. package/examples/server/typescript/index.ts +2 -3
  9. package/examples/server/typescript/package-lock.json +5406 -0
  10. package/examples/server/typescript/package.json +3 -4
  11. package/package.json +1 -1
  12. package/examples/client/react-typescript/README.md +0 -44
  13. package/examples/client/react-typescript/package-lock.json +0 -13909
  14. package/examples/client/react-typescript/package.json +0 -39
  15. package/examples/client/react-typescript/public/favicon.ico +0 -0
  16. package/examples/client/react-typescript/public/index.html +0 -43
  17. package/examples/client/react-typescript/public/logo192.png +0 -0
  18. package/examples/client/react-typescript/public/logo512.png +0 -0
  19. package/examples/client/react-typescript/public/manifest.json +0 -25
  20. package/examples/client/react-typescript/public/robots.txt +0 -3
  21. package/examples/client/react-typescript/src/App.css +0 -38
  22. package/examples/client/react-typescript/src/App.test.tsx +0 -9
  23. package/examples/client/react-typescript/src/App.tsx +0 -26
  24. package/examples/client/react-typescript/src/index.css +0 -13
  25. package/examples/client/react-typescript/src/index.tsx +0 -17
  26. package/examples/client/react-typescript/src/logo.svg +0 -7
  27. package/examples/client/react-typescript/src/react-app-env.d.ts +0 -1
  28. package/examples/client/react-typescript/src/serviceWorker.ts +0 -149
  29. package/examples/client/react-typescript/src/setupTests.ts +0 -5
  30. package/examples/client/react-typescript/tsconfig.json +0 -25
  31. package/examples/client/vanilla-js/index.html +0 -21
  32. package/examples/full-example-react/client/README.md +0 -68
  33. package/examples/full-example-react/client/package-lock.json +0 -14134
  34. package/examples/full-example-react/client/package.json +0 -36
  35. package/examples/full-example-react/client/public/favicon.ico +0 -0
  36. package/examples/full-example-react/client/public/index.html +0 -43
  37. package/examples/full-example-react/client/public/logo192.png +0 -0
  38. package/examples/full-example-react/client/public/logo512.png +0 -0
  39. package/examples/full-example-react/client/public/manifest.json +0 -25
  40. package/examples/full-example-react/client/public/robots.txt +0 -3
  41. package/examples/full-example-react/client/src/App.css +0 -14
  42. package/examples/full-example-react/client/src/App.js +0 -58
  43. package/examples/full-example-react/client/src/App.test.js +0 -9
  44. package/examples/full-example-react/client/src/index.css +0 -13
  45. package/examples/full-example-react/client/src/index.js +0 -17
  46. package/examples/full-example-react/client/src/logo.svg +0 -7
  47. package/examples/full-example-react/client/src/serviceWorker.js +0 -141
  48. package/examples/full-example-react/client/src/setupTests.js +0 -5
  49. package/examples/full-example-react/client/src/sssetupProxy.js +0 -6
  50. package/examples/full-example-react/server/index.js +0 -42
  51. package/examples/full-example-react/server/init.sql +0 -7
  52. package/examples/full-example-react/server/package.json +0 -18
  53. package/examples/full-example-typescript/package copy.json +0 -16
@@ -4,7 +4,7 @@ import path from 'path';
4
4
  var http = require('http').createServer(app);
5
5
  var io = require("socket.io")(http);
6
6
  http.listen(30009);
7
- var prostgles = require("../../dist/index");
7
+ import prostgles from "prostgles-server"
8
8
 
9
9
  import { DBObj } from "./DBoGenerated";
10
10
 
@@ -17,34 +17,26 @@ prostgles({
17
17
  user: process.env.PRGL_USER,
18
18
  password: process.env.PRGL_PWD
19
19
  },
20
- // dbOptions: {
21
- // application_name: "prostgles_api",
22
- // max: 100,
23
- // poolIdleTimeout: 10000
24
- // },
20
+
25
21
  sqlFilePath: path.join(__dirname+'/init.sql'),
26
22
  io,
27
23
  tsGeneratedTypesDir: path.join(__dirname + '/'),
28
- publish: (socket, dbo ) => {
29
- // if(!socket || !socket._user.admin && !socket._user.id){
30
- // return false;
31
- // }
32
-
24
+ publish: () => {
33
25
 
34
26
  return {
35
27
  planes: "*"
36
28
  }
37
29
  },
38
- // publishMethods: (socket, dbo: DBObj) => {
39
- // return {
40
- // insertPlanes: async (data) => {
41
- // // let tl = Date.now();
42
- // let res = await (dbo.planes).insert(data);
43
- // // console.log(Date.now() - tl, "ms");
44
- // return res;
45
- // }
46
- // }
47
- // },
30
+ publishMethods: ({ dbo }) => {
31
+ return {
32
+ insertPlanes: async (data) => {
33
+ // let tl = Date.now();
34
+ let res = await (dbo.planes).insert(data);
35
+ // console.log(Date.now() - tl, "ms");
36
+ return res;
37
+ }
38
+ }
39
+ },
48
40
 
49
41
  onReady: async (dbo: DBObj) => {
50
42
 
@@ -59,16 +51,4 @@ prostgles({
59
51
  res.status(404).send('Page not found');
60
52
  });
61
53
  },
62
- // onSocketConnect: async ({ socket, dbo }) => {
63
- // return true;
64
- // },
65
- // onSocketDisconnect: async ({ socket, dbo }) => {
66
- // return true;
67
- // },
68
- // auth: {
69
- // login: (data, { socket, dbo }) => {},
70
- // register: (data, { socket, dbo }) => {},
71
- // logout: (data, { socket, dbo }) => {},
72
- // onChange: (state, { socket, dbo }) => {},
73
- // },
74
54
  });