prostgles-server 4.2.134 → 4.2.136
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/Auth/AuthHandler.d.ts +66 -0
- package/dist/Auth/AuthHandler.d.ts.map +1 -0
- package/dist/Auth/AuthHandler.js +425 -0
- package/dist/Auth/AuthHandler.js.map +1 -0
- package/dist/Auth/AuthTypes.d.ts +218 -0
- package/dist/Auth/AuthTypes.d.ts.map +1 -0
- package/dist/Auth/AuthTypes.js +3 -0
- package/dist/Auth/AuthTypes.js.map +1 -0
- package/dist/Auth/authInit.d.ts +3 -0
- package/dist/Auth/authInit.d.ts.map +1 -0
- package/dist/Auth/authInit.js +155 -0
- package/dist/Auth/authInit.js.map +1 -0
- package/dist/Auth/getSafeReturnURL.d.ts +2 -0
- package/dist/Auth/getSafeReturnURL.d.ts.map +1 -0
- package/dist/Auth/getSafeReturnURL.js +35 -0
- package/dist/Auth/getSafeReturnURL.js.map +1 -0
- package/dist/Auth/setAuthSignup.d.ts +5 -0
- package/dist/Auth/setAuthSignup.d.ts.map +1 -0
- package/dist/Auth/setAuthSignup.js +85 -0
- package/dist/Auth/setAuthSignup.js.map +1 -0
- package/dist/DboBuilder/DboBuilderTypes.d.ts +3 -3
- package/dist/DboBuilder/DboBuilderTypes.d.ts.map +1 -1
- package/dist/DboBuilder/DboBuilderTypes.js.map +1 -1
- package/dist/DboBuilder/QueryBuilder/getNewQuery.d.ts +1 -1
- package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts +1 -1
- package/dist/DboBuilder/runSQL.d.ts +1 -1
- package/dist/FileManager/initFileManager.js +1 -1
- package/dist/FileManager/initFileManager.js.map +1 -1
- package/dist/Filtering.d.ts +1 -1
- package/dist/Prostgles.d.ts +1 -1
- package/dist/Prostgles.d.ts.map +1 -1
- package/dist/Prostgles.js +1 -1
- package/dist/Prostgles.js.map +1 -1
- package/dist/ProstglesTypes.d.ts +1 -1
- package/dist/ProstglesTypes.d.ts.map +1 -1
- package/dist/PublishParser/PublishParser.d.ts +2 -2
- package/dist/PublishParser/PublishParser.d.ts.map +1 -1
- package/dist/PublishParser/PublishParser.js.map +1 -1
- package/dist/PublishParser/getFileTableRules.d.ts +1 -1
- package/dist/PublishParser/getFileTableRules.d.ts.map +1 -1
- package/dist/PublishParser/getSchemaFromPublish.d.ts +1 -1
- package/dist/PublishParser/getSchemaFromPublish.d.ts.map +1 -1
- package/dist/PublishParser/getTableRulesWithoutFileTable.d.ts +1 -1
- package/dist/PublishParser/getTableRulesWithoutFileTable.d.ts.map +1 -1
- package/dist/PublishParser/publishTypesAndUtils.d.ts +1 -1
- package/dist/PublishParser/publishTypesAndUtils.d.ts.map +1 -1
- package/dist/PublishParser/publishTypesAndUtils.js.map +1 -1
- package/dist/RestApi.d.ts +1 -1
- package/dist/RestApi.d.ts.map +1 -1
- package/dist/RestApi.js +1 -1
- package/dist/RestApi.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/initProstgles.js +1 -1
- package/dist/initProstgles.js.map +1 -1
- package/dist/runClientRequest.d.ts +1 -1
- package/dist/runClientRequest.d.ts.map +1 -1
- package/dist/runClientRequest.js +1 -1
- package/dist/runClientRequest.js.map +1 -1
- package/lib/Auth/AuthHandler.ts +474 -0
- package/lib/Auth/AuthTypes.ts +247 -0
- package/lib/Auth/authInit.ts +166 -0
- package/lib/Auth/getSafeReturnURL.ts +35 -0
- package/lib/Auth/setAuthSignup.ts +100 -0
- package/lib/DBSchemaBuilder.ts +1 -1
- package/lib/DboBuilder/DboBuilderTypes.ts +4 -3
- package/lib/FileManager/initFileManager.ts +1 -1
- package/lib/Prostgles.ts +2 -2
- package/lib/ProstglesTypes.ts +1 -1
- package/lib/PublishParser/PublishParser.ts +3 -3
- package/lib/PublishParser/getFileTableRules.ts +1 -1
- package/lib/PublishParser/getSchemaFromPublish.ts +1 -1
- package/lib/PublishParser/getTableRulesWithoutFileTable.ts +1 -1
- package/lib/PublishParser/publishTypesAndUtils.ts +1 -1
- package/lib/RestApi.ts +2 -1
- package/lib/index.ts +1 -1
- package/lib/initProstgles.ts +1 -1
- package/lib/runClientRequest.ts +3 -3
- package/package.json +14 -4
- package/tests/client/index.ts +9 -7
- package/tests/client/package-lock.json +2827 -143
- package/tests/client/package.json +1 -1
- package/tests/client/tsconfig.json +0 -6
- package/tests/clientFileTests.spec.ts +2 -3
- package/tests/clientOnlyQueries.spec.ts +2 -2
- package/tests/clientRestApi.spec.ts +2 -2
- package/tests/server/index.ts +1 -1
- package/tests/server/package-lock.json +62 -77
- package/tests/server/package.json +2 -2
- package/tests/server/tsconfig.json +1 -2
- package/tests/serverOnlyQueries.spec.ts +2 -2
- package/tsconfig.json +0 -1
- package/lib/AuthHandler.ts +0 -816
package/lib/index.ts
CHANGED
package/lib/initProstgles.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as pgPromise from "pg-promise";
|
|
2
2
|
import pg from "pg-promise/typescript/pg-subset";
|
|
3
3
|
import { isEmpty } from "prostgles-types";
|
|
4
|
-
import { AuthHandler } from "./AuthHandler";
|
|
4
|
+
import { AuthHandler } from "./Auth/AuthHandler";
|
|
5
5
|
import { DBEventsManager } from "./DBEventsManager";
|
|
6
6
|
import { DBOFullyTyped } from "./DBSchemaBuilder";
|
|
7
7
|
import { DBHandlerServer, Prostgles, getIsSuperUser } from "./Prostgles";
|
package/lib/runClientRequest.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyObject, TableHandler, getKeys, pickKeys } from "prostgles-types";
|
|
2
|
-
import { ExpressReq
|
|
1
|
+
import { AnyObject, TableHandler, UserLike, getKeys, pickKeys } from "prostgles-types";
|
|
2
|
+
import { ExpressReq } from "./Auth/AuthTypes";
|
|
3
3
|
import { LocalParams, PRGLIOSocket } from "./DboBuilder/DboBuilder";
|
|
4
4
|
import { parseFieldFilter } from "./DboBuilder/ViewHandler/parseFieldFilter";
|
|
5
5
|
import { canRunSQL } from "./DboBuilder/runSQL";
|
|
@@ -50,7 +50,7 @@ export const runClientRequest = async function(this: Prostgles, args: Args){
|
|
|
50
50
|
const valid_table_command_rules = await this.publishParser.getValidatedRequestRule({ tableName, command, localParams: reqInfo }, clientInfo);
|
|
51
51
|
if (valid_table_command_rules) {
|
|
52
52
|
const sessionUser: UserLike | undefined = !clientInfo?.user? undefined : {
|
|
53
|
-
...parseFieldFilter(clientInfo.sessionFields ?? [], false,
|
|
53
|
+
...parseFieldFilter(clientInfo.sessionFields ?? [] as any, false, Object.keys(clientInfo.user)),
|
|
54
54
|
...pickKeys(clientInfo.user, ["id", "type"]) as UserLike,
|
|
55
55
|
}
|
|
56
56
|
const localParams: LocalParams = { ...reqInfo, isRemoteRequest: { user: sessionUser } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prostgles-server",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.136",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,20 +38,30 @@
|
|
|
38
38
|
"body-parser": "^1.20.3",
|
|
39
39
|
"check-disk-space": "^3.4.0",
|
|
40
40
|
"file-type": "^18.5.0",
|
|
41
|
+
"passport": "^0.7.0",
|
|
42
|
+
"passport-facebook": "^3.0.0",
|
|
43
|
+
"passport-github2": "^0.1.12",
|
|
44
|
+
"passport-google-oauth20": "^2.0.0",
|
|
45
|
+
"passport-microsoft": "^2.1.0",
|
|
41
46
|
"pg": "^8.11.5",
|
|
42
47
|
"pg-cursor": "^2.11.0",
|
|
43
48
|
"pg-promise": "^11.9.1",
|
|
44
|
-
"prostgles-types": "^4.0.
|
|
49
|
+
"prostgles-types": "^4.0.105"
|
|
45
50
|
},
|
|
46
51
|
"devDependencies": {
|
|
47
52
|
"@types/express": "^4.17.21",
|
|
48
53
|
"@types/json-schema": "^7.0.15",
|
|
49
54
|
"@types/node": "^22.8.1",
|
|
55
|
+
"@types/passport": "^1.0.17",
|
|
56
|
+
"@types/passport-facebook": "^3.0.3",
|
|
57
|
+
"@types/passport-github2": "^1.2.9",
|
|
58
|
+
"@types/passport-google-oauth20": "^2.0.16",
|
|
59
|
+
"@types/passport-microsoft": "^1.0.3",
|
|
50
60
|
"@types/pg": "^8.11.5",
|
|
51
61
|
"@types/pg-cursor": "^2.7.2",
|
|
52
62
|
"@types/sharp": "^0.30.4",
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
54
|
-
"@typescript-eslint/parser": "^8.
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
64
|
+
"@typescript-eslint/parser": "^8.15.0",
|
|
55
65
|
"eslint": "^8.51.0",
|
|
56
66
|
"socket.io": "^4.8.1",
|
|
57
67
|
"typescript": "^5.3.3"
|
package/tests/client/index.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import prostgles from "prostgles-client";
|
|
2
2
|
import io from "socket.io-client";
|
|
3
3
|
|
|
4
|
+
import { AuthHandler } from "prostgles-client/dist/Auth";
|
|
5
|
+
export { AuthHandler } from "prostgles-client/dist/Auth";
|
|
6
|
+
import type { DBHandlerClient, MethodHandler } from "prostgles-client/dist/prostgles";
|
|
7
|
+
import { DBSchemaTable } from "prostgles-types";
|
|
8
|
+
import { clientFileTests } from "../clientFileTests.spec";
|
|
9
|
+
import { clientOnlyQueries } from "../clientOnlyQueries.spec";
|
|
10
|
+
import { clientRestApi } from "../clientRestApi.spec";
|
|
4
11
|
import { isomorphicQueries } from "../isomorphicQueries.spec";
|
|
5
|
-
import { clientOnlyQueries } from "../clientOnlyQueries.spec";
|
|
6
|
-
import { clientRestApi } from "../clientRestApi.spec";
|
|
7
|
-
import { clientFileTests } from "../clientFileTests.spec";
|
|
8
|
-
import type { Auth, DBHandlerClient, MethodHandler } from "prostgles-client/dist/prostgles";
|
|
9
|
-
export { DBHandlerClient, Auth } from "prostgles-client/dist/prostgles";
|
|
10
12
|
import { clientHooks } from "./hooks.spec";
|
|
11
13
|
import { newly_created_table, useProstglesTest } from "./useProstgles.spec";
|
|
12
|
-
|
|
14
|
+
export { DBHandlerClient } from "prostgles-client/dist/prostgles";
|
|
13
15
|
|
|
14
16
|
const start = Date.now();
|
|
15
17
|
const log = (msgOrObj: any, extra?: any) => {
|
|
@@ -35,7 +37,7 @@ type ClientTestSpecV2 = (args: {
|
|
|
35
37
|
methods: MethodHandler;
|
|
36
38
|
tableSchema: DBSchemaTable[];
|
|
37
39
|
isReconnect?: boolean;
|
|
38
|
-
auth:
|
|
40
|
+
auth: AuthHandler;
|
|
39
41
|
}) => Promise<void>;
|
|
40
42
|
|
|
41
43
|
const tests: Record<string, ClientTestSpecV2> = {
|