prostgles-server 2.0.165 → 2.0.168
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 -0
- package/dist/DboBuilder.js.map +1 -1
- package/dist/Filtering.d.ts.map +1 -1
- package/dist/Filtering.js +4 -0
- package/dist/Filtering.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 -0
- package/lib/Filtering.ts +5 -0
- 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
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"socket.io": "^4.0.1"
|
|
12
|
+
"express": "latest",
|
|
13
|
+
"prostgles-server": "latest",
|
|
14
|
+
"socket.io": "latest"
|
|
16
15
|
}
|
|
17
16
|
}
|
package/lib/DboBuilder.ts
CHANGED
|
@@ -2106,6 +2106,28 @@ export class TableHandler extends ViewHandler {
|
|
|
2106
2106
|
if(!fields) throw ` Invalid update rule for ${this.name}. fields missing `;
|
|
2107
2107
|
finalUpdateFilter = getUpdateFilter({ filter, forcedFilter, $and_key })
|
|
2108
2108
|
if(tableRules.update.dynamicFields?.length){
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* Ensure that dynamicFields.fields are less permissive than fields
|
|
2112
|
+
* This is because an update filter can target dynamicFields.filter AND also other records
|
|
2113
|
+
*/
|
|
2114
|
+
if(testRule){
|
|
2115
|
+
const defaultFields = this.parseFieldFilter(fields);
|
|
2116
|
+
const morePermissiveRule = tableRules.update.dynamicFields.find(r => {
|
|
2117
|
+
const ruleFields = this.parseFieldFilter(r.fields);
|
|
2118
|
+
return defaultFields.length && defaultFields.every(f => ruleFields.includes(f)) && ruleFields.length > defaultFields.length;
|
|
2119
|
+
});
|
|
2120
|
+
|
|
2121
|
+
if(morePermissiveRule){
|
|
2122
|
+
throw `${this.name}.update.dynamicFields must be less permissive than the default ${this.name}.update.fields.
|
|
2123
|
+
This is because an update filter can target dynamicFields.filter AND also other records.
|
|
2124
|
+
Bad dynamicFields.fields: ${this.parseFieldFilter(morePermissiveRule.fields)}
|
|
2125
|
+
default fields: ${defaultFields}
|
|
2126
|
+
Bad dynamicFields: ${JSON.stringify(morePermissiveRule)}
|
|
2127
|
+
`;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2109
2131
|
let found = false;
|
|
2110
2132
|
for await(const dfRule of tableRules.update.dynamicFields){
|
|
2111
2133
|
if(!found){
|
|
@@ -2131,6 +2153,7 @@ export class TableHandler extends ViewHandler {
|
|
|
2131
2153
|
throw " issue with forcedData: \nVALUE: " + JSON.stringify(forcedData, null, 2) + "\nERROR: " + e;
|
|
2132
2154
|
}
|
|
2133
2155
|
}
|
|
2156
|
+
|
|
2134
2157
|
return true as unknown as any;
|
|
2135
2158
|
}
|
|
2136
2159
|
}
|
package/lib/Filtering.ts
CHANGED
|
@@ -289,6 +289,11 @@ export const parseFilterItem = (args: ParseFilterItemArgs): string => {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
} else {
|
|
292
|
+
/** Maybe it's an object key which means it's an equality comparison against a json object */
|
|
293
|
+
if(selItem?.column_udt_type?.startsWith("json")){
|
|
294
|
+
return leftQ + " = " + parseRightVal(fVal);
|
|
295
|
+
}
|
|
296
|
+
|
|
292
297
|
return mErr("Unrecognised filter operand: " + fOpType + " ");
|
|
293
298
|
}
|
|
294
299
|
|
package/package.json
CHANGED
package/tests/client/PID.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
44563
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
|
2
|
-
|
|
3
|
-
## Available Scripts
|
|
4
|
-
|
|
5
|
-
In the project directory, you can run:
|
|
6
|
-
|
|
7
|
-
### `npm start`
|
|
8
|
-
|
|
9
|
-
Runs the app in the development mode.<br />
|
|
10
|
-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
|
11
|
-
|
|
12
|
-
The page will reload if you make edits.<br />
|
|
13
|
-
You will also see any lint errors in the console.
|
|
14
|
-
|
|
15
|
-
### `npm test`
|
|
16
|
-
|
|
17
|
-
Launches the test runner in the interactive watch mode.<br />
|
|
18
|
-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
19
|
-
|
|
20
|
-
### `npm run build`
|
|
21
|
-
|
|
22
|
-
Builds the app for production to the `build` folder.<br />
|
|
23
|
-
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
24
|
-
|
|
25
|
-
The build is minified and the filenames include the hashes.<br />
|
|
26
|
-
Your app is ready to be deployed!
|
|
27
|
-
|
|
28
|
-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
|
29
|
-
|
|
30
|
-
### `npm run eject`
|
|
31
|
-
|
|
32
|
-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
|
33
|
-
|
|
34
|
-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
|
35
|
-
|
|
36
|
-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
|
|
37
|
-
|
|
38
|
-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
|
|
39
|
-
|
|
40
|
-
## Learn More
|
|
41
|
-
|
|
42
|
-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
|
43
|
-
|
|
44
|
-
To learn React, check out the [React documentation](https://reactjs.org/).
|