@prosopo/client-example-server 2.7.122 → 2.7.124
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/.turbo/turbo-build$colon$cjs.log +15 -31
- package/.turbo/turbo-build$colon$tsc.log +21 -21
- package/.turbo/turbo-build.log +16 -31
- package/CHANGELOG.md +35 -0
- package/dist/_virtual/_rolldown/runtime.js +3 -0
- package/dist/app.d.ts +15 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +122 -93
- package/dist/app.js.map +1 -1
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs/app.cjs +148 -106
- package/dist/cjs/controllers/auth.cjs +180 -244
- package/dist/cjs/models/user.cjs +21 -22
- package/dist/cjs/routes/routes.cjs +21 -24
- package/dist/cjs/utils/connection.cjs +20 -23
- package/dist/cjs/utils/database.cjs +3 -28
- package/dist/controllers/auth.d.ts +1 -1
- package/dist/controllers/auth.d.ts.map +1 -1
- package/dist/controllers/auth.js +173 -241
- package/dist/controllers/auth.js.map +1 -1
- package/dist/models/user.d.ts +2 -2
- package/dist/models/user.js +18 -22
- package/dist/routes/routes.d.ts.map +1 -1
- package/dist/routes/routes.js +18 -24
- package/dist/routes/routes.js.map +1 -1
- package/dist/tests/app.unit.test.d.ts +2 -0
- package/dist/tests/app.unit.test.d.ts.map +1 -0
- package/dist/tests/app.unit.test.js +318 -0
- package/dist/tests/app.unit.test.js.map +1 -0
- package/dist/tests/appEntrypoint.unit.test.d.ts +2 -0
- package/dist/tests/appEntrypoint.unit.test.d.ts.map +1 -0
- package/dist/tests/appEntrypoint.unit.test.js +100 -0
- package/dist/tests/appEntrypoint.unit.test.js.map +1 -0
- package/dist/tests/auth.unit.test.d.ts +2 -0
- package/dist/tests/auth.unit.test.d.ts.map +1 -0
- package/dist/tests/auth.unit.test.js +426 -0
- package/dist/tests/auth.unit.test.js.map +1 -0
- package/dist/tests/authHarness.d.ts +40 -0
- package/dist/tests/authHarness.d.ts.map +1 -0
- package/dist/tests/authHarness.js +57 -0
- package/dist/tests/authHarness.js.map +1 -0
- package/dist/tests/clientExampleServer.test-d.d.ts +2 -0
- package/dist/tests/clientExampleServer.test-d.d.ts.map +1 -0
- package/dist/tests/clientExampleServer.test-d.js +84 -0
- package/dist/tests/clientExampleServer.test-d.js.map +1 -0
- package/dist/tests/routes.unit.test.d.ts +2 -0
- package/dist/tests/routes.unit.test.d.ts.map +1 -0
- package/dist/tests/routes.unit.test.js +123 -0
- package/dist/tests/routes.unit.test.js.map +1 -0
- package/dist/tests/utils.unit.test.d.ts +2 -0
- package/dist/tests/utils.unit.test.d.ts.map +1 -0
- package/dist/tests/utils.unit.test.js +125 -0
- package/dist/tests/utils.unit.test.js.map +1 -0
- package/dist/utils/connection.js +14 -19
- package/dist/utils/database.js +4 -8
- package/package.json +17 -14
- package/src/app.ts +114 -73
- package/src/controllers/auth.ts +40 -31
- package/src/routes/routes.ts +5 -2
- package/src/tests/app.unit.test.ts +428 -0
- package/src/tests/appEntrypoint.unit.test.ts +154 -0
- package/src/tests/auth.unit.test.ts +859 -0
- package/src/tests/authHarness.ts +131 -0
- package/src/tests/clientExampleServer.test-d.ts +146 -0
- package/src/tests/routes.unit.test.ts +166 -0
- package/src/tests/utils.unit.test.ts +169 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.test.config.ts +18 -0
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/client-example-server@2.7.
|
|
2
|
+
> @prosopo/client-example-server@2.7.124 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
|
-
▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
|
|
6
|
-
|
|
7
|
-
package.json:11:3:
|
|
8
|
-
11 │ "types": "./dist/app.d.ts"
|
|
9
|
-
╵ ~~~~~~~
|
|
10
|
-
|
|
11
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
12
|
-
|
|
13
|
-
package.json:9:3:
|
|
14
|
-
9 │ "import": "./dist/index.js",
|
|
15
|
-
╵ ~~~~~~~~
|
|
16
|
-
|
|
17
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
18
|
-
|
|
19
|
-
package.json:10:3:
|
|
20
|
-
10 │ "require": "./dist/cjs/index.cjs",
|
|
21
|
-
╵ ~~~~~~~~~
|
|
22
|
-
|
|
23
5
|
ViteCommonJSConfig: .
|
|
24
6
|
{
|
|
25
7
|
tsConfigPaths: [
|
|
@@ -61,17 +43,19 @@ ViteCommonJSConfig: .
|
|
|
61
43
|
'@prosopo/load-balancer'
|
|
62
44
|
]
|
|
63
45
|
}
|
|
64
|
-
[
|
|
46
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
47
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
65
48
|
Bundle build started
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[32m✓[39m 6 modules transformed.
|
|
69
|
-
[33mEntry module "src/utils/database.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.[39m
|
|
49
|
+
[2K
|
|
50
|
+
✓ 7 modules transformed.
|
|
70
51
|
rendering chunks...
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
52
|
+
computing gzip size...
|
|
53
|
+
dist/cjs/utils/database.cjs 0.26 kB │ gzip: 0.17 kB
|
|
54
|
+
dist/cjs/models/user.cjs 0.60 kB │ gzip: 0.26 kB
|
|
55
|
+
dist/cjs/utils/connection.cjs 0.89 kB │ gzip: 0.44 kB
|
|
56
|
+
dist/cjs/routes/routes.cjs 0.94 kB │ gzip: 0.41 kB
|
|
57
|
+
dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip: 0.50 kB
|
|
58
|
+
dist/cjs/app.cjs 6.62 kB │ gzip: 2.36 kB
|
|
59
|
+
dist/cjs/controllers/auth.cjs 7.62 kB │ gzip: 2.39 kB
|
|
60
|
+
|
|
61
|
+
[32m✓ built in 74ms[39m
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/client-example-server@2.7.
|
|
2
|
+
> @prosopo/client-example-server@2.7.124 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
12:37:02 PM - Projects in this build:
|
|
6
6
|
* ../../dev/config/tsconfig.json
|
|
7
7
|
* ../../packages/locale/tsconfig.json
|
|
8
8
|
* ../../packages/util/tsconfig.json
|
|
@@ -22,41 +22,41 @@
|
|
|
22
22
|
* ../../packages/server/tsconfig.json
|
|
23
23
|
* tsconfig.json
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
12:37:02 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/index.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
12:37:02 PM - Project '../../packages/locale/tsconfig.json' is up to date because newest input '../../packages/locale/src/translationKey.ts' is older than output '../../packages/locale/tsconfig.tsbuildinfo'
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
12:37:02 PM - Project '../../packages/util/tsconfig.json' is up to date because newest input '../../packages/util/src/url.ts' is older than output '../../packages/util/tsconfig.tsbuildinfo'
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
12:37:02 PM - Project '../../packages/logger/tsconfig.json' is up to date because newest input '../../packages/logger/src/index.ts' is older than output '../../packages/logger/tsconfig.tsbuildinfo'
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
12:37:02 PM - Project '../../packages/util-crypto/tsconfig.json' is up to date because newest input '../../packages/util-crypto/src/types.ts' is older than output '../../packages/util-crypto/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
12:37:02 PM - Project '../../packages/types/tsconfig.json' is up to date because newest input '../../packages/types/src/provider/api.ts' is older than output '../../packages/types/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
12:37:02 PM - Project '../../packages/common/tsconfig.json' is up to date because newest input '../../packages/common/src/index.ts' is older than output '../../packages/common/tsconfig.tsbuildinfo'
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
12:37:02 PM - Project '../../packages/api-route/tsconfig.json' is up to date because newest input '../../packages/api-route/src/tests/apiRoute.unit.test.ts' is older than output '../../packages/api-route/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
12:37:02 PM - Project '../../packages/redis-client/tsconfig.json' is up to date because newest input '../../packages/redis-client/src/index.ts' is older than output '../../packages/redis-client/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
12:37:02 PM - Project '../../packages/api/tsconfig.json' is up to date because newest input '../../packages/api/src/tests/apiHarness.ts' is older than output '../../packages/api/tsconfig.tsbuildinfo'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
12:37:02 PM - Project '../../packages/user-access-policy/tsconfig.json' is up to date because newest input '../../packages/user-access-policy/src/transformRule.ts' is older than output '../../packages/user-access-policy/tsconfig.tsbuildinfo'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
12:37:02 PM - Project '../../packages/types-database/tsconfig.json' is up to date because newest input '../../packages/types-database/src/types/bannedDomain.ts' is older than output '../../packages/types-database/tsconfig.tsbuildinfo'
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
12:37:02 PM - Project '../../packages/database/tsconfig.json' is up to date because newest input '../../packages/database/src/tests/unit/redisCacheEscalation.unit.test.ts' is older than output '../../packages/database/tsconfig.tsbuildinfo'
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
12:37:02 PM - Project '../../packages/dotenv/tsconfig.json' is up to date because newest input '../../packages/dotenv/src/index.ts' is older than output '../../packages/dotenv/tsconfig.tsbuildinfo'
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
12:37:02 PM - Project '../../packages/keyring/tsconfig.json' is up to date because newest input '../../packages/keyring/src/keyring/keyring.ts' is older than output '../../packages/keyring/tsconfig.tsbuildinfo'
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
12:37:02 PM - Project '../../packages/load-balancer/tsconfig.json' is up to date because newest input '../../packages/load-balancer/src/tests/providers.unit.test.ts' is older than output '../../packages/load-balancer/tsconfig.tsbuildinfo'
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
12:37:02 PM - Project '../../packages/server/tsconfig.json' is up to date because newest input '../../packages/server/src/config.ts' is older than output '../../packages/server/tsconfig.tsbuildinfo'
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
12:37:02 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
12:37:02 PM - Building project '/home/runner/work/captcha/captcha/demos/client-example-server/tsconfig.json'...
|
|
62
62
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/client-example-server@2.7.
|
|
2
|
+
> @prosopo/client-example-server@2.7.124 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/client-example-server@2.7.
|
|
6
|
+
> @prosopo/client-example-server@2.7.124 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
|
-
▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
|
|
10
|
-
|
|
11
|
-
package.json:11:3:
|
|
12
|
-
11 │ "types": "./dist/app.d.ts"
|
|
13
|
-
╵ ~~~~~~~
|
|
14
|
-
|
|
15
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
16
|
-
|
|
17
|
-
package.json:9:3:
|
|
18
|
-
9 │ "import": "./dist/index.js",
|
|
19
|
-
╵ ~~~~~~~~
|
|
20
|
-
|
|
21
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
22
|
-
|
|
23
|
-
package.json:10:3:
|
|
24
|
-
10 │ "require": "./dist/cjs/index.cjs",
|
|
25
|
-
╵ ~~~~~~~~~
|
|
26
|
-
|
|
27
9
|
ViteEsmConfig: .
|
|
28
10
|
{
|
|
29
11
|
tsConfigPaths: [
|
|
@@ -65,16 +47,19 @@ ViteEsmConfig: .
|
|
|
65
47
|
'@prosopo/load-balancer'
|
|
66
48
|
]
|
|
67
49
|
}
|
|
68
|
-
[
|
|
50
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
51
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
69
52
|
Bundle build started
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[32m✓[39m 6 modules transformed.
|
|
53
|
+
[2K
|
|
54
|
+
✓ 7 modules transformed.
|
|
73
55
|
rendering chunks...
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
56
|
+
computing gzip size...
|
|
57
|
+
dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
58
|
+
dist/utils/database.js 0.23 kB │ gzip: 0.17 kB
|
|
59
|
+
dist/models/user.js 0.45 kB │ gzip: 0.21 kB
|
|
60
|
+
dist/utils/connection.js 0.64 kB │ gzip: 0.35 kB
|
|
61
|
+
dist/routes/routes.js 0.79 kB │ gzip: 0.37 kB
|
|
62
|
+
dist/app.js 5.54 kB │ gzip: 2.16 kB
|
|
63
|
+
dist/controllers/auth.js 6.94 kB │ gzip: 2.26 kB
|
|
64
|
+
|
|
65
|
+
[32m✓ built in 65ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @prosopo/client-example-server
|
|
2
2
|
|
|
3
|
+
## 2.7.124
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- fe9424f: Add unit and type tests for the client example server, and fix the defects they exposed:
|
|
7
|
+
|
|
8
|
+
- `getRoutes` built one module-level router shared by every call, so a second call stacked handlers on the first call's bound config.
|
|
9
|
+
- `isAuth` could fall through without sending a response, and could send twice for a malformed `Authorization` header.
|
|
10
|
+
- The `if (passwordHash)` guard in signup had no else branch, leaving a request hanging when it was falsy.
|
|
11
|
+
- A `serverUrl` without a port resolved to `NaN`, so the server listened on an arbitrary free port; it now falls back to 9228.
|
|
12
|
+
- Removed the unreachable `OPTIONS` handler (`cors()` already answers preflight) and leftover debug logging.
|
|
13
|
+
- `app.ts` no longer boots a server on import; it exports `createApp`, `startServer` and `main`, and only runs when executed directly.
|
|
14
|
+
- Updated dependencies [69f8dcd]
|
|
15
|
+
- @prosopo/database@3.15.21
|
|
16
|
+
- @prosopo/server@2.10.42
|
|
17
|
+
|
|
18
|
+
## 2.7.123
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- e14fce6: chore(deps): bump vite to 6.4.3 and mongoose to 8.24.1, and adjust types for the mongoose 8.24 Document/ObjectId changes
|
|
22
|
+
- Updated dependencies [2c47bb7]
|
|
23
|
+
- Updated dependencies [0e1171c]
|
|
24
|
+
- Updated dependencies [103318c]
|
|
25
|
+
- Updated dependencies [4cd9035]
|
|
26
|
+
- Updated dependencies [8fba211]
|
|
27
|
+
- Updated dependencies [270a8d8]
|
|
28
|
+
- Updated dependencies [e14fce6]
|
|
29
|
+
- @prosopo/util@3.3.5
|
|
30
|
+
- @prosopo/types@4.10.0
|
|
31
|
+
- @prosopo/dotenv@3.0.50
|
|
32
|
+
- @prosopo/common@3.1.48
|
|
33
|
+
- @prosopo/database@3.15.20
|
|
34
|
+
- @prosopo/keyring@2.9.61
|
|
35
|
+
- @prosopo/server@2.10.41
|
|
36
|
+
- @prosopo/logger@2.0.4
|
|
37
|
+
|
|
3
38
|
## 2.7.122
|
|
4
39
|
### Patch Changes
|
|
5
40
|
|
package/dist/app.d.ts
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Server } from "node:http";
|
|
2
|
+
import type { ProsopoServerConfigOutput } from "@prosopo/types";
|
|
3
|
+
import express from "express";
|
|
4
|
+
export declare enum ProsopoVerificationType {
|
|
5
|
+
api = "api",
|
|
6
|
+
local = "local"
|
|
7
|
+
}
|
|
8
|
+
export declare const resolveVerifyEndpoint: () => string;
|
|
9
|
+
export declare const resolveVerifyType: () => ProsopoVerificationType;
|
|
10
|
+
export declare const isDevelopmentOrTest: () => boolean;
|
|
11
|
+
export declare const createApp: () => express.Express;
|
|
12
|
+
export declare const DEFAULT_PORT = 9228;
|
|
13
|
+
export declare const resolvePort: (config: ProsopoServerConfigOutput) => number;
|
|
14
|
+
export declare const startServer: (app: express.Express, port: number, dirname?: string) => Server;
|
|
15
|
+
export declare function main(): Promise<Server>;
|
|
2
16
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AASxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAGhE,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,oBAAY,uBAAuB;IAClC,GAAG,QAAQ;IACX,KAAK,UAAU;CACf;AAUD,eAAO,MAAM,qBAAqB,QAAO,MAQxC,CAAC;AAGF,eAAO,MAAM,iBAAiB,QAAO,uBAKN,CAAC;AAEhC,eAAO,MAAM,mBAAmB,QAAO,OACmC,CAAC;AAG3E,eAAO,MAAM,SAAS,QAAO,OAAO,CAAC,OA8BpC,CAAC;AAEF,eAAO,MAAM,YAAY,OAAO,CAAC;AAOjC,eAAO,MAAM,WAAW,WAAY,yBAAyB,KAAG,MAM/D,CAAC;AAMF,eAAO,MAAM,WAAW,QAClB,OAAO,CAAC,OAAO,QACd,MAAM,YACH,MAAM,KACb,MA6BF,CAAC;AAEF,wBAAsB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAwC5C"}
|
package/dist/app.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import getRoutes from "./routes/routes.js";
|
|
3
|
+
import connectionFactory from "./utils/connection.js";
|
|
4
|
+
import memoryServerSetup from "./utils/database.js";
|
|
1
5
|
import fs from "node:fs";
|
|
2
6
|
import http from "node:http";
|
|
3
7
|
import https from "node:https";
|
|
@@ -7,102 +11,127 @@ import { ProsopoEnvError } from "@prosopo/common";
|
|
|
7
11
|
import { loadEnv } from "@prosopo/dotenv";
|
|
8
12
|
import { getLogger } from "@prosopo/logger";
|
|
9
13
|
import { getServerConfig } from "@prosopo/server";
|
|
10
|
-
import { at } from "@prosopo/util";
|
|
14
|
+
import { at, isMain } from "@prosopo/util";
|
|
11
15
|
import cors from "cors";
|
|
12
16
|
import express from "express";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
//#region src/app.ts
|
|
18
|
+
var ProsopoVerificationType = /* @__PURE__ */ function(ProsopoVerificationType) {
|
|
19
|
+
ProsopoVerificationType["api"] = "api";
|
|
20
|
+
ProsopoVerificationType["local"] = "local";
|
|
21
|
+
return ProsopoVerificationType;
|
|
22
|
+
}({});
|
|
23
|
+
var logger = getLogger("info", "client-example-server:app");
|
|
24
|
+
/**
|
|
25
|
+
* The siteverify endpoint the deployment talks to. Non-production
|
|
26
|
+
* environments get their name as a subdomain prefix. An unset NODE_ENV is
|
|
27
|
+
* treated as production: prefixing it produced `undefined-api.prosopo.io`,
|
|
28
|
+
* a host that does not exist.
|
|
29
|
+
*/
|
|
30
|
+
var resolveVerifyEndpoint = () => {
|
|
31
|
+
const environment = process.env.NODE_ENV;
|
|
32
|
+
const apiPrefix = !environment || environment === "production" ? "" : `${environment}-`;
|
|
33
|
+
return process.env.PROSOPO_VERIFY_ENDPOINT || `https://${apiPrefix}api.prosopo.io/siteverify`;
|
|
34
|
+
};
|
|
35
|
+
/** Anything the enum doesn't name falls back to the hosted API. */
|
|
36
|
+
var resolveVerifyType = () => Object.keys(ProsopoVerificationType).includes(process.env.PROSOPO_VERIFICATION_TYPE) ? process.env.PROSOPO_VERIFICATION_TYPE : "api";
|
|
37
|
+
var isDevelopmentOrTest = () => process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
|
|
38
|
+
/** The express app, minus the routes, which need a database connection. */
|
|
39
|
+
var createApp = () => {
|
|
40
|
+
const app = express();
|
|
41
|
+
app.set("trust proxy", 1);
|
|
42
|
+
app.use(cors({
|
|
43
|
+
origin: true,
|
|
44
|
+
credentials: true
|
|
45
|
+
}));
|
|
46
|
+
app.use(express.urlencoded({ extended: true }));
|
|
47
|
+
app.use(express.json());
|
|
48
|
+
app.use((_, res, next) => {
|
|
49
|
+
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
50
|
+
res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE");
|
|
51
|
+
res.setHeader("Access-Control-Allow-Headers", "Origin, Content-Type, X-Auth-Token, Authorization");
|
|
52
|
+
next();
|
|
53
|
+
});
|
|
54
|
+
return app;
|
|
55
|
+
};
|
|
56
|
+
var DEFAULT_PORT = 9228;
|
|
57
|
+
/**
|
|
58
|
+
* The port is the last segment of the configured server URL. A URL without
|
|
59
|
+
* one used to yield NaN, which node turns into an arbitrary free port — the
|
|
60
|
+
* server came up on an address nothing was configured to talk to.
|
|
61
|
+
*/
|
|
62
|
+
var resolvePort = (config) => {
|
|
63
|
+
if (!config.serverUrl) return DEFAULT_PORT;
|
|
64
|
+
const segments = config.serverUrl.split(":");
|
|
65
|
+
if (segments.length < 3) return DEFAULT_PORT;
|
|
66
|
+
const port = Number.parseInt(at(segments, 2));
|
|
67
|
+
return Number.isNaN(port) ? DEFAULT_PORT : port;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* HTTPS in development/test when the repo's certificates exist, plain HTTP
|
|
71
|
+
* otherwise — in production Caddy terminates TLS.
|
|
72
|
+
*/
|
|
73
|
+
var startServer = (app, port, dirname = path.dirname(fileURLToPath(import.meta.url))) => {
|
|
74
|
+
if (isDevelopmentOrTest()) {
|
|
75
|
+
const certsDir = path.resolve(dirname, "../../../certs");
|
|
76
|
+
const keyPath = path.join(certsDir, "server.key");
|
|
77
|
+
const certPath = path.join(certsDir, "server.crt");
|
|
78
|
+
if (fs.existsSync(keyPath) && fs.existsSync(certPath)) {
|
|
79
|
+
const httpsOptions = {
|
|
80
|
+
key: fs.readFileSync(keyPath),
|
|
81
|
+
cert: fs.readFileSync(certPath)
|
|
82
|
+
};
|
|
83
|
+
return https.createServer(httpsOptions, app).listen(port, () => {
|
|
84
|
+
logger.info(() => ({ msg: `HTTPS server started on port ${port}` }));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
logger.warn(() => ({ msg: "Certificates not found, starting HTTP server instead. Run ./setup_certs.sh to enable HTTPS in development." }));
|
|
88
|
+
return http.createServer(app).listen(port, () => {
|
|
89
|
+
logger.info(() => ({ msg: `HTTP server started on port ${port}` }));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return http.createServer(app).listen(port, () => {
|
|
93
|
+
logger.info(() => ({ msg: `HTTP server started on port ${port} (TLS handled by reverse proxy)` }));
|
|
94
|
+
});
|
|
95
|
+
};
|
|
23
96
|
async function main() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
logger.info(() => ({ msg: process.env.MONGO_URI }));
|
|
57
|
-
const uri = process.env.MONGO_URI || await memoryServerSetup();
|
|
58
|
-
logger.info(() => ({ msg: "mongo uri", data: { uri } }));
|
|
59
|
-
const mongoose = connectionFactory(uri);
|
|
60
|
-
if (!process.env.PROSOPO_SITE_PRIVATE_KEY) {
|
|
61
|
-
const mnemonicError = new ProsopoEnvError("GENERAL.MNEMONIC_UNDEFINED", {
|
|
62
|
-
context: { missingParams: ["PROSOPO_SITE_PRIVATE_KEY"] },
|
|
63
|
-
logger
|
|
64
|
-
});
|
|
65
|
-
logger.error(() => ({ err: mnemonicError }));
|
|
66
|
-
}
|
|
67
|
-
const config = getServerConfig();
|
|
68
|
-
logger.info(() => ({ msg: "Config", data: { config } }));
|
|
69
|
-
app.use(getRoutes(mongoose, config, verifyEndpoint, verifyType));
|
|
70
|
-
const port = config.serverUrl ? Number.parseInt(at(config.serverUrl.split(":"), 2)) : 9228;
|
|
71
|
-
logger.info(() => ({ msg: "Listening on port", data: { port } }));
|
|
72
|
-
const isDev = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
|
|
73
|
-
if (isDev) {
|
|
74
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
75
|
-
const __dirname = path.dirname(__filename);
|
|
76
|
-
const certsDir = path.resolve(__dirname, "../../../certs");
|
|
77
|
-
const keyPath = path.join(certsDir, "server.key");
|
|
78
|
-
const certPath = path.join(certsDir, "server.crt");
|
|
79
|
-
if (fs.existsSync(keyPath) && fs.existsSync(certPath)) {
|
|
80
|
-
const httpsOptions = {
|
|
81
|
-
key: fs.readFileSync(keyPath),
|
|
82
|
-
cert: fs.readFileSync(certPath)
|
|
83
|
-
};
|
|
84
|
-
https.createServer(httpsOptions, app).listen(port, () => {
|
|
85
|
-
logger.info(() => ({ msg: `HTTPS server started on port ${port}` }));
|
|
86
|
-
});
|
|
87
|
-
} else {
|
|
88
|
-
logger.warn(() => ({
|
|
89
|
-
msg: "Certificates not found, starting HTTP server instead. Run ./setup_certs.sh to enable HTTPS in development."
|
|
90
|
-
}));
|
|
91
|
-
http.createServer(app).listen(port, () => {
|
|
92
|
-
logger.info(() => ({ msg: `HTTP server started on port ${port}` }));
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
} else {
|
|
96
|
-
http.createServer(app).listen(port, () => {
|
|
97
|
-
logger.info(() => ({
|
|
98
|
-
msg: `HTTP server started on port ${port} (TLS handled by reverse proxy)`
|
|
99
|
-
}));
|
|
100
|
-
});
|
|
101
|
-
}
|
|
97
|
+
loadEnv();
|
|
98
|
+
const verifyEndpoint = resolveVerifyEndpoint();
|
|
99
|
+
logger.info(() => ({ data: { verifyEndpoint } }));
|
|
100
|
+
const verifyType = resolveVerifyType();
|
|
101
|
+
const app = createApp();
|
|
102
|
+
if (!process.env.MONGO_URI && !isDevelopmentOrTest()) throw new Error("Cannot run mongo memory when NODE_ENV is neither development nor test");
|
|
103
|
+
logger.info(() => ({ msg: process.env.MONGO_URI }));
|
|
104
|
+
const uri = process.env.MONGO_URI || await memoryServerSetup();
|
|
105
|
+
logger.info(() => ({
|
|
106
|
+
msg: "mongo uri",
|
|
107
|
+
data: { uri }
|
|
108
|
+
}));
|
|
109
|
+
const mongoose = connectionFactory(uri);
|
|
110
|
+
if (!process.env.PROSOPO_SITE_PRIVATE_KEY) {
|
|
111
|
+
const mnemonicError = new ProsopoEnvError("GENERAL.MNEMONIC_UNDEFINED", {
|
|
112
|
+
context: { missingParams: ["PROSOPO_SITE_PRIVATE_KEY"] },
|
|
113
|
+
logger
|
|
114
|
+
});
|
|
115
|
+
logger.error(() => ({ err: mnemonicError }));
|
|
116
|
+
}
|
|
117
|
+
const config = getServerConfig();
|
|
118
|
+
logger.info(() => ({
|
|
119
|
+
msg: "Config",
|
|
120
|
+
data: { config }
|
|
121
|
+
}));
|
|
122
|
+
app.use(getRoutes(mongoose, config, verifyEndpoint, verifyType));
|
|
123
|
+
const port = resolvePort(config);
|
|
124
|
+
logger.info(() => ({
|
|
125
|
+
msg: "Listening on port",
|
|
126
|
+
data: { port }
|
|
127
|
+
}));
|
|
128
|
+
return startServer(app, port);
|
|
102
129
|
}
|
|
103
|
-
main().then(() => {
|
|
104
|
-
|
|
130
|
+
if (isMain(import.meta.url)) main().then(() => {
|
|
131
|
+
logger.info(() => ({ msg: "Server started" }));
|
|
105
132
|
}).catch((err) => {
|
|
106
|
-
|
|
107
|
-
|
|
133
|
+
logger.error(() => ({ err }));
|
|
134
|
+
process.exit(1);
|
|
108
135
|
});
|
|
136
|
+
//#endregion
|
|
137
|
+
export { DEFAULT_PORT, ProsopoVerificationType, createApp, isDevelopmentOrTest, main, resolvePort, resolveVerifyEndpoint, resolveVerifyType, startServer };
|
package/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM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AAE,CAAC,CAAC,CAAC;IAElE,OAAO,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAID,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC7B,IAAI,EAAE;SACJ,IAAI,CAAC,GAAG,EAAE;QACV,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QAG9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|