@aeriajs/server 0.0.178 → 0.0.180
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/init.d.ts +2 -1
- package/dist/init.js +5 -1
- package/dist/init.mjs +6 -2
- package/package.json +9 -9
package/dist/init.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouteContext, Collection, GenericRequest, ApiConfig, AuthenticatedToken, NonCircularJsonSchema } from '@aeriajs/types';
|
|
2
|
-
import { ACError } from '@aeriajs/types';
|
|
2
|
+
import { ACError, HTTPStatus } from '@aeriajs/types';
|
|
3
3
|
import { type createRouter } from '@aeriajs/http';
|
|
4
4
|
import { DEFAULT_API_CONFIG } from './constants.js';
|
|
5
5
|
export type InitApiConfig = Omit<ApiConfig, keyof typeof DEFAULT_API_CONFIG> & Partial<Pick<ApiConfig, keyof typeof DEFAULT_API_CONFIG>>;
|
|
@@ -119,6 +119,7 @@ export declare const getToken: (request: GenericRequest, context: RouteContext)
|
|
|
119
119
|
} | {
|
|
120
120
|
readonly _tag: "Error";
|
|
121
121
|
readonly error: {
|
|
122
|
+
readonly httpStatus: HTTPStatus.Unauthorized;
|
|
122
123
|
readonly code: ACError.AuthenticationError;
|
|
123
124
|
};
|
|
124
125
|
readonly result: undefined;
|
package/dist/init.js
CHANGED
|
@@ -40,6 +40,7 @@ const getToken = async (request, context) => {
|
|
|
40
40
|
console.trace(err);
|
|
41
41
|
}
|
|
42
42
|
return (0, common_1.endpointError)({
|
|
43
|
+
httpStatus: types_1.HTTPStatus.Unauthorized,
|
|
43
44
|
code: types_1.ACError.AuthenticationError,
|
|
44
45
|
});
|
|
45
46
|
}
|
|
@@ -60,7 +61,10 @@ const init = (_options = {}) => {
|
|
|
60
61
|
await options.setup(parentContext);
|
|
61
62
|
}
|
|
62
63
|
await (0, warmup_js_1.warmup)();
|
|
63
|
-
const serverOptions = (0, http_1.defineServerOptions)(
|
|
64
|
+
const serverOptions = (0, http_1.defineServerOptions)({
|
|
65
|
+
host: options.config.host,
|
|
66
|
+
port: options.config.port,
|
|
67
|
+
});
|
|
64
68
|
const apiRouter = (0, routes_js_1.registerRoutes)();
|
|
65
69
|
const server = (0, node_http_1.registerServer)(serverOptions, async (request, response) => {
|
|
66
70
|
if ((0, http_1.cors)(request, response) === null) {
|
package/dist/init.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { Result, ACError } from "@aeriajs/types";
|
|
2
|
+
import { Result, ACError, HTTPStatus } from "@aeriajs/types";
|
|
3
3
|
import { endpointError, throwIfError, deepMerge } from "@aeriajs/common";
|
|
4
4
|
import { defineServerOptions, cors, wrapRouteExecution } from "@aeriajs/http";
|
|
5
5
|
import { registerServer } from "@aeriajs/node-http";
|
|
@@ -35,6 +35,7 @@ export const getToken = async (request, context) => {
|
|
|
35
35
|
console.trace(err);
|
|
36
36
|
}
|
|
37
37
|
return endpointError({
|
|
38
|
+
httpStatus: HTTPStatus.Unauthorized,
|
|
38
39
|
code: ACError.AuthenticationError
|
|
39
40
|
});
|
|
40
41
|
}
|
|
@@ -54,7 +55,10 @@ export const init = (_options = {}) => {
|
|
|
54
55
|
await options.setup(parentContext);
|
|
55
56
|
}
|
|
56
57
|
await warmup();
|
|
57
|
-
const serverOptions = defineServerOptions(
|
|
58
|
+
const serverOptions = defineServerOptions({
|
|
59
|
+
host: options.config.host,
|
|
60
|
+
port: options.config.port
|
|
61
|
+
});
|
|
58
62
|
const apiRouter = registerRoutes();
|
|
59
63
|
const server = registerServer(serverOptions, async (request, response) => {
|
|
60
64
|
if (cors(request, response) === null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.180",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"mongodb": "^6.5.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@aeriajs/core": "^0.0.
|
|
37
|
-
"@aeriajs/builtins": "^0.0.
|
|
38
|
-
"@aeriajs/common": "^0.0.
|
|
39
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
40
|
-
"@aeriajs/http": "^0.0.
|
|
41
|
-
"@aeriajs/node-http": "^0.0.
|
|
42
|
-
"@aeriajs/server": "^0.0.
|
|
43
|
-
"@aeriajs/types": "^0.0.
|
|
36
|
+
"@aeriajs/core": "^0.0.178",
|
|
37
|
+
"@aeriajs/builtins": "^0.0.178",
|
|
38
|
+
"@aeriajs/common": "^0.0.108",
|
|
39
|
+
"@aeriajs/entrypoint": "^0.0.111",
|
|
40
|
+
"@aeriajs/http": "^0.0.122",
|
|
41
|
+
"@aeriajs/node-http": "^0.0.122",
|
|
42
|
+
"@aeriajs/server": "^0.0.180",
|
|
43
|
+
"@aeriajs/types": "^0.0.91",
|
|
44
44
|
"mongodb": "^6.5.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|