adorn-api 1.0.12 → 1.0.14
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/adapter/express/auth.d.ts +8 -0
- package/dist/adapter/express/auth.d.ts.map +1 -1
- package/dist/adapter/express/bootstrap.d.ts +12 -0
- package/dist/adapter/express/bootstrap.d.ts.map +1 -1
- package/dist/adapter/express/coercion.d.ts +81 -1
- package/dist/adapter/express/coercion.d.ts.map +1 -1
- package/dist/adapter/express/index.d.ts +1 -0
- package/dist/adapter/express/index.d.ts.map +1 -1
- package/dist/adapter/express/merge.d.ts +17 -0
- package/dist/adapter/express/merge.d.ts.map +1 -1
- package/dist/adapter/express/openapi.d.ts +55 -0
- package/dist/adapter/express/openapi.d.ts.map +1 -1
- package/dist/adapter/express/router.d.ts +6 -0
- package/dist/adapter/express/router.d.ts.map +1 -1
- package/dist/adapter/express/swagger.d.ts +6 -0
- package/dist/adapter/express/swagger.d.ts.map +1 -1
- package/dist/adapter/express/types.d.ts +26 -0
- package/dist/adapter/express/types.d.ts.map +1 -1
- package/dist/adapter/express/validation.d.ts +19 -2
- package/dist/adapter/express/validation.d.ts.map +1 -1
- package/dist/cli.cjs +1016 -445
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1016 -445
- package/dist/cli.js.map +1 -1
- package/dist/compiler/analyze/index.d.ts +5 -0
- package/dist/compiler/analyze/index.d.ts.map +1 -0
- package/dist/compiler/analyze/scanControllers.d.ts +52 -0
- package/dist/compiler/analyze/scanControllers.d.ts.map +1 -1
- package/dist/compiler/cache/isStale.d.ts +26 -0
- package/dist/compiler/cache/isStale.d.ts.map +1 -1
- package/dist/compiler/cache/loadArtifacts.d.ts +36 -0
- package/dist/compiler/cache/loadArtifacts.d.ts.map +1 -1
- package/dist/compiler/cache/schema.d.ts +14 -0
- package/dist/compiler/cache/schema.d.ts.map +1 -1
- package/dist/compiler/cache/writeCache.d.ts +6 -0
- package/dist/compiler/cache/writeCache.d.ts.map +1 -1
- package/dist/compiler/gems.d.ts +75 -0
- package/dist/compiler/gems.d.ts.map +1 -0
- package/dist/compiler/generator/index.d.ts +7 -0
- package/dist/compiler/generator/index.d.ts.map +1 -0
- package/dist/compiler/generator/manifest.d.ts +23 -0
- package/dist/compiler/generator/manifest.d.ts.map +1 -0
- package/dist/compiler/generator/openapi.d.ts +118 -0
- package/dist/compiler/generator/openapi.d.ts.map +1 -0
- package/dist/compiler/graph/builder.d.ts +24 -0
- package/dist/compiler/graph/builder.d.ts.map +1 -0
- package/dist/compiler/graph/index.d.ts +7 -0
- package/dist/compiler/graph/index.d.ts.map +1 -0
- package/dist/compiler/graph/schemaGraph.d.ts +67 -0
- package/dist/compiler/graph/schemaGraph.d.ts.map +1 -0
- package/dist/compiler/graph/types.d.ts +203 -0
- package/dist/compiler/graph/types.d.ts.map +1 -0
- package/dist/compiler/index.d.ts +12 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/ir/index.d.ts +7 -0
- package/dist/compiler/ir/index.d.ts.map +1 -0
- package/dist/compiler/ir/pipeline.d.ts +82 -0
- package/dist/compiler/ir/pipeline.d.ts.map +1 -0
- package/dist/compiler/ir/stages.d.ts +40 -0
- package/dist/compiler/ir/stages.d.ts.map +1 -0
- package/dist/compiler/ir/visitor.d.ts +98 -0
- package/dist/compiler/ir/visitor.d.ts.map +1 -0
- package/dist/compiler/manifest/emit.d.ts +14 -0
- package/dist/compiler/manifest/emit.d.ts.map +1 -1
- package/dist/compiler/manifest/format.d.ts +42 -0
- package/dist/compiler/manifest/format.d.ts.map +1 -1
- package/dist/compiler/manifest/index.d.ts +6 -0
- package/dist/compiler/manifest/index.d.ts.map +1 -0
- package/dist/compiler/runner/createProgram.d.ts +16 -0
- package/dist/compiler/runner/createProgram.d.ts.map +1 -1
- package/dist/compiler/runner/index.d.ts +5 -0
- package/dist/compiler/runner/index.d.ts.map +1 -0
- package/dist/compiler/schema/extractAnnotations.d.ts +47 -0
- package/dist/compiler/schema/extractAnnotations.d.ts.map +1 -1
- package/dist/compiler/schema/index.d.ts +6 -0
- package/dist/compiler/schema/index.d.ts.map +1 -0
- package/dist/compiler/schema/intersectionHandler.d.ts +44 -0
- package/dist/compiler/schema/intersectionHandler.d.ts.map +1 -0
- package/dist/compiler/schema/objectHandler.d.ts +106 -0
- package/dist/compiler/schema/objectHandler.d.ts.map +1 -0
- package/dist/compiler/schema/openapi.d.ts +16 -1
- package/dist/compiler/schema/openapi.d.ts.map +1 -1
- package/dist/compiler/schema/parameters.d.ts +90 -0
- package/dist/compiler/schema/parameters.d.ts.map +1 -0
- package/dist/compiler/schema/primitives.d.ts +68 -0
- package/dist/compiler/schema/primitives.d.ts.map +1 -0
- package/dist/compiler/schema/typeToJsonSchema.d.ts +22 -51
- package/dist/compiler/schema/typeToJsonSchema.d.ts.map +1 -1
- package/dist/compiler/schema/types.d.ts +69 -0
- package/dist/compiler/schema/types.d.ts.map +1 -0
- package/dist/compiler/schema/unionHandler.d.ts +70 -0
- package/dist/compiler/schema/unionHandler.d.ts.map +1 -0
- package/dist/compiler/transform/dedup.d.ts +35 -0
- package/dist/compiler/transform/dedup.d.ts.map +1 -0
- package/dist/compiler/transform/flatten.d.ts +50 -0
- package/dist/compiler/transform/flatten.d.ts.map +1 -0
- package/dist/compiler/transform/index.d.ts +7 -0
- package/dist/compiler/transform/index.d.ts.map +1 -0
- package/dist/compiler/transform/inline.d.ts +46 -0
- package/dist/compiler/transform/inline.d.ts.map +1 -0
- package/dist/compiler/validation/emitPrecompiledValidators.d.ts +16 -0
- package/dist/compiler/validation/emitPrecompiledValidators.d.ts.map +1 -1
- package/dist/compiler/validation/index.d.ts +5 -0
- package/dist/compiler/validation/index.d.ts.map +1 -0
- package/dist/decorators/Auth.d.ts +17 -0
- package/dist/decorators/Auth.d.ts.map +1 -1
- package/dist/decorators/Controller.d.ts +15 -0
- package/dist/decorators/Controller.d.ts.map +1 -1
- package/dist/decorators/Public.d.ts +13 -0
- package/dist/decorators/Public.d.ts.map +1 -1
- package/dist/decorators/Use.d.ts +18 -0
- package/dist/decorators/Use.d.ts.map +1 -1
- package/dist/decorators/methods.d.ts +20 -0
- package/dist/decorators/methods.d.ts.map +1 -1
- package/dist/express.cjs +73 -54
- package/dist/express.cjs.map +1 -1
- package/dist/express.js +73 -54
- package/dist/express.js.map +1 -1
- package/dist/http.d.ts +1 -2
- package/dist/http.d.ts.map +1 -1
- package/dist/index.cjs +161 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +156 -3
- package/dist/index.js.map +1 -1
- package/dist/metal/applyListQuery.d.ts +73 -0
- package/dist/metal/applyListQuery.d.ts.map +1 -1
- package/dist/metal/index.cjs +2 -2
- package/dist/metal/index.cjs.map +1 -1
- package/dist/metal/index.d.ts +4 -0
- package/dist/metal/index.d.ts.map +1 -1
- package/dist/metal/index.js +2 -2
- package/dist/metal/index.js.map +1 -1
- package/dist/metal/listQuery.d.ts +19 -0
- package/dist/metal/listQuery.d.ts.map +1 -1
- package/dist/metal/queryOptions.d.ts +8 -0
- package/dist/metal/queryOptions.d.ts.map +1 -1
- package/dist/metal/readMetalBag.d.ts +36 -0
- package/dist/metal/readMetalBag.d.ts.map +1 -1
- package/dist/metal/registerMetalEntities.d.ts +20 -0
- package/dist/metal/registerMetalEntities.d.ts.map +1 -1
- package/dist/metal/schemaFromEntity.d.ts +30 -0
- package/dist/metal/schemaFromEntity.d.ts.map +1 -1
- package/dist/metal/searchWhere.d.ts +39 -0
- package/dist/metal/searchWhere.d.ts.map +1 -1
- package/dist/metal/symbolMetadata.d.ts +6 -0
- package/dist/metal/symbolMetadata.d.ts.map +1 -1
- package/dist/runtime/auth/runtime.d.ts +155 -6
- package/dist/runtime/auth/runtime.d.ts.map +1 -1
- package/dist/runtime/metadata/bucket.d.ts +1 -2
- package/dist/runtime/metadata/bucket.d.ts.map +1 -1
- package/dist/runtime/metadata/key.d.ts +1 -1
- package/dist/runtime/metadata/key.d.ts.map +1 -1
- package/dist/runtime/metadata/read.d.ts +1 -2
- package/dist/runtime/metadata/read.d.ts.map +1 -1
- package/dist/runtime/metadata/types.d.ts +74 -0
- package/dist/runtime/metadata/types.d.ts.map +1 -1
- package/dist/runtime/polyfill.d.ts +1 -1
- package/dist/runtime/polyfill.d.ts.map +1 -1
- package/dist/runtime/upload.d.ts +37 -0
- package/dist/runtime/upload.d.ts.map +1 -1
- package/dist/runtime/validation/ajv.d.ts +100 -0
- package/dist/runtime/validation/ajv.d.ts.map +1 -1
- package/dist/runtime/validation/index.d.ts +9 -0
- package/dist/runtime/validation/index.d.ts.map +1 -1
- package/dist/scripts/adorn-example.cjs +238 -6
- package/dist/scripts/adorn-example.cjs.map +1 -1
- package/dist/utils/port.d.ts +9 -0
- package/dist/utils/port.d.ts.map +1 -0
- package/package.json +4 -1
package/dist/express.cjs
CHANGED
|
@@ -167,11 +167,25 @@ function computeBoundRoutes(controllers, manifest) {
|
|
|
167
167
|
var import_ajv = __toESM(require("ajv"), 1);
|
|
168
168
|
var import_ajv_formats = __toESM(require("ajv-formats"), 1);
|
|
169
169
|
var ValidationErrorResponse = class extends Error {
|
|
170
|
+
/**
|
|
171
|
+
* HTTP status code for validation errors.
|
|
172
|
+
*/
|
|
173
|
+
statusCode;
|
|
174
|
+
/**
|
|
175
|
+
* Detailed validation errors.
|
|
176
|
+
*/
|
|
177
|
+
errors;
|
|
178
|
+
/**
|
|
179
|
+
* Creates a new ValidationErrorResponse.
|
|
180
|
+
*
|
|
181
|
+
* @param statusCode - HTTP status code (typically 400)
|
|
182
|
+
* @param errors - Array of validation errors
|
|
183
|
+
*/
|
|
170
184
|
constructor(statusCode, errors) {
|
|
171
185
|
super("Validation failed");
|
|
186
|
+
this.name = "ValidationErrorResponse";
|
|
172
187
|
this.statusCode = statusCode;
|
|
173
188
|
this.errors = errors;
|
|
174
|
-
this.name = "ValidationErrorResponse";
|
|
175
189
|
}
|
|
176
190
|
};
|
|
177
191
|
function createValidator() {
|
|
@@ -216,7 +230,7 @@ async function getMtime(filePath) {
|
|
|
216
230
|
async function loadArtifacts(options) {
|
|
217
231
|
const { outDir } = options;
|
|
218
232
|
const cacheKey = import_node_path.default.resolve(outDir);
|
|
219
|
-
|
|
233
|
+
const entry = artifactCache.get(cacheKey);
|
|
220
234
|
const openapiPath = import_node_path.default.join(outDir, "openapi.json");
|
|
221
235
|
const manifestPath = import_node_path.default.join(outDir, "manifest.json");
|
|
222
236
|
const validatorsPath = import_node_path.default.join(outDir, "validators.mjs");
|
|
@@ -477,13 +491,16 @@ function getRawQueryString(req) {
|
|
|
477
491
|
if (index === -1) return "";
|
|
478
492
|
return url.slice(index + 1);
|
|
479
493
|
}
|
|
480
|
-
function parseDeepObjectParams(rawQuery, names) {
|
|
494
|
+
function parseDeepObjectParams(rawQuery, names, maxDepth = 5) {
|
|
481
495
|
const out = {};
|
|
482
496
|
if (!rawQuery || names.size === 0) return out;
|
|
483
497
|
const params = new URLSearchParams(rawQuery);
|
|
484
498
|
for (const [key, value] of params.entries()) {
|
|
485
499
|
const path3 = parseBracketPath(key);
|
|
486
500
|
if (path3.length === 0) continue;
|
|
501
|
+
if (path3.length > maxDepth) {
|
|
502
|
+
throw new Error(`Query parameter nesting depth (${path3.length}) exceeds maximum of ${maxDepth}`);
|
|
503
|
+
}
|
|
487
504
|
const root = path3[0];
|
|
488
505
|
if (!names.has(root)) continue;
|
|
489
506
|
assignDeepValue(out, path3, value);
|
|
@@ -596,10 +613,10 @@ function createAuthMiddleware(authConfig, routeAuth, globalSecurity) {
|
|
|
596
613
|
}
|
|
597
614
|
|
|
598
615
|
// src/adapter/express/validation.ts
|
|
599
|
-
function validateRequestWithPrecompiled(route, req, validators) {
|
|
616
|
+
function validateRequestWithPrecompiled(route, req, validators, maxDepth = 5) {
|
|
600
617
|
const errors = [];
|
|
601
618
|
const deepNames = new Set(route.args.query.filter((q) => q.serialization?.style === "deepObject").map((q) => q.name));
|
|
602
|
-
const deepValues = deepNames.size > 0 ? parseDeepObjectParams(getRawQueryString(req), deepNames) : {};
|
|
619
|
+
const deepValues = deepNames.size > 0 ? parseDeepObjectParams(getRawQueryString(req), deepNames, maxDepth) : {};
|
|
603
620
|
if (route.args.body) {
|
|
604
621
|
const validator = validators[route.operationId]?.body;
|
|
605
622
|
if (validator) {
|
|
@@ -622,10 +639,10 @@ function validateRequestWithPrecompiled(route, req, validators) {
|
|
|
622
639
|
if (q.content === "application/json" && typeof value === "string") {
|
|
623
640
|
try {
|
|
624
641
|
value = JSON.parse(value);
|
|
625
|
-
} catch
|
|
642
|
+
} catch {
|
|
626
643
|
errors.push({
|
|
627
644
|
path: `#/query/${q.name}`,
|
|
628
|
-
message:
|
|
645
|
+
message: "Invalid JSON string",
|
|
629
646
|
keyword: "json",
|
|
630
647
|
params: {}
|
|
631
648
|
});
|
|
@@ -635,11 +652,11 @@ function validateRequestWithPrecompiled(route, req, validators) {
|
|
|
635
652
|
}
|
|
636
653
|
return errors.length > 0 ? errors : null;
|
|
637
654
|
}
|
|
638
|
-
function validateRequest(route, req, openapi, validator) {
|
|
655
|
+
function validateRequest(route, req, openapi, validator, maxDepth = 5) {
|
|
639
656
|
const openapiOperation = getOpenApiOperation(openapi, route);
|
|
640
657
|
const paramSchemaIndex = getParamSchemaIndex(openapiOperation);
|
|
641
658
|
const deepNames = new Set(route.args.query.filter((q) => q.serialization?.style === "deepObject").map((q) => q.name));
|
|
642
|
-
const deepValues = deepNames.size > 0 ? parseDeepObjectParams(getRawQueryString(req), deepNames) : {};
|
|
659
|
+
const deepValues = deepNames.size > 0 ? parseDeepObjectParams(getRawQueryString(req), deepNames, maxDepth) : {};
|
|
643
660
|
const errors = [];
|
|
644
661
|
if (route.args.body) {
|
|
645
662
|
const bodySchema = getSchemaByRef(openapi, route.args.body.schemaRef);
|
|
@@ -663,10 +680,10 @@ function validateRequest(route, req, openapi, validator) {
|
|
|
663
680
|
if (q.content === "application/json" && typeof value === "string") {
|
|
664
681
|
try {
|
|
665
682
|
value = JSON.parse(value);
|
|
666
|
-
} catch
|
|
683
|
+
} catch {
|
|
667
684
|
errors.push({
|
|
668
685
|
path: `#/query/${q.name}`,
|
|
669
|
-
message:
|
|
686
|
+
message: "Invalid JSON string",
|
|
670
687
|
keyword: "json",
|
|
671
688
|
params: {}
|
|
672
689
|
});
|
|
@@ -744,7 +761,7 @@ function validateRequest(route, req, openapi, validator) {
|
|
|
744
761
|
|
|
745
762
|
// src/adapter/express/router.ts
|
|
746
763
|
async function createExpressRouter(options) {
|
|
747
|
-
const { controllers, artifactsDir = ".adorn", middleware = {}, defaultPageSize = 10 } = options;
|
|
764
|
+
const { controllers, artifactsDir = ".adorn", middleware = {}, defaultPageSize = 10, queryOptions } = options;
|
|
748
765
|
let manifest;
|
|
749
766
|
let openapi;
|
|
750
767
|
let precompiledValidators = null;
|
|
@@ -814,10 +831,15 @@ async function createExpressRouter(options) {
|
|
|
814
831
|
}
|
|
815
832
|
router[method](route.fullPath, ...middlewareChain, async (req, res, next) => {
|
|
816
833
|
try {
|
|
817
|
-
const
|
|
834
|
+
const maxDepth = queryOptions?.maxNestingDepth ?? 5;
|
|
835
|
+
const validationErrors = precompiledValidators ? validateRequestWithPrecompiled(route, req, precompiledValidators, maxDepth) : validateRequest(route, req, openapi, validator, maxDepth);
|
|
818
836
|
if (validationErrors) {
|
|
819
837
|
return res.status(400).json(formatValidationErrors(validationErrors));
|
|
820
838
|
}
|
|
839
|
+
const deepNames = new Set(
|
|
840
|
+
route.args.query.filter((q) => q.serialization?.style === "deepObject").map((q) => q.name)
|
|
841
|
+
);
|
|
842
|
+
const deepValues = deepNames.size > 0 ? parseDeepObjectParams(getRawQueryString(req), deepNames, maxDepth) : {};
|
|
821
843
|
const instance = getInstance(route.controllerCtor);
|
|
822
844
|
const handler = instance[route.methodName];
|
|
823
845
|
if (typeof handler !== "function") {
|
|
@@ -843,13 +865,13 @@ async function createExpressRouter(options) {
|
|
|
843
865
|
}
|
|
844
866
|
if (jsonArgs.length > 0) {
|
|
845
867
|
for (const q of jsonArgs) {
|
|
846
|
-
const rawValue = req.query[q.name];
|
|
868
|
+
const rawValue = q.serialization?.style === "deepObject" ? deepValues[q.name] : req.query[q.name];
|
|
847
869
|
if (rawValue === void 0 || rawValue === null) continue;
|
|
848
870
|
let parsed = rawValue;
|
|
849
871
|
if (typeof rawValue === "string" && rawValue.length > 0) {
|
|
850
872
|
try {
|
|
851
873
|
parsed = JSON.parse(rawValue);
|
|
852
|
-
} catch
|
|
874
|
+
} catch {
|
|
853
875
|
parsed = rawValue;
|
|
854
876
|
}
|
|
855
877
|
}
|
|
@@ -863,7 +885,7 @@ async function createExpressRouter(options) {
|
|
|
863
885
|
}
|
|
864
886
|
if (standardArgs.length > 0) {
|
|
865
887
|
for (const q of standardArgs) {
|
|
866
|
-
const rawValue = req.query[q.name];
|
|
888
|
+
const rawValue = q.serialization?.style === "deepObject" ? deepValues[q.name] : req.query[q.name];
|
|
867
889
|
if (rawValue === void 0) continue;
|
|
868
890
|
const parsed = parseQueryValue(rawValue, q);
|
|
869
891
|
const paramSchema = getParamSchemaFromIndex(paramSchemaIndex, "query", q.name) ?? (q.schemaRef ? getSchemaByRef(openapi, q.schemaRef) : null) ?? schemaFromType(q.schemaType);
|
|
@@ -975,41 +997,40 @@ function setupSwagger(options = {}) {
|
|
|
975
997
|
var import_express3 = __toESM(require("express"), 1);
|
|
976
998
|
var import_node_path4 = __toESM(require("path"), 1);
|
|
977
999
|
function bootstrap(options) {
|
|
978
|
-
return new Promise(
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
});
|
|
1000
|
+
return new Promise((resolve2, reject) => {
|
|
1001
|
+
const {
|
|
1002
|
+
controllers,
|
|
1003
|
+
port: userPort,
|
|
1004
|
+
host: userHost,
|
|
1005
|
+
artifactsDir: userArtifactsDir = ".adorn",
|
|
1006
|
+
enableSwagger = true,
|
|
1007
|
+
swaggerPath = "/docs",
|
|
1008
|
+
swaggerJsonPath = "/docs/openapi.json",
|
|
1009
|
+
middleware,
|
|
1010
|
+
auth,
|
|
1011
|
+
coerce
|
|
1012
|
+
} = options;
|
|
1013
|
+
if (controllers.length === 0) {
|
|
1014
|
+
reject(new Error("At least one controller must be provided to bootstrap()."));
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
const envPort = process.env.PORT;
|
|
1018
|
+
const port = userPort ?? (envPort !== void 0 ? Number(envPort) : 3e3);
|
|
1019
|
+
const host = userHost ?? process.env.HOST ?? "0.0.0.0";
|
|
1020
|
+
if (isNaN(port) || port < 0 || port > 65535) {
|
|
1021
|
+
reject(new Error(`Invalid port: ${port}. Port must be between 0 and 65535.`));
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
const absoluteArtifactsDir = import_node_path4.default.isAbsolute(userArtifactsDir) ? userArtifactsDir : import_node_path4.default.resolve(process.cwd(), userArtifactsDir);
|
|
1025
|
+
const app = (0, import_express3.default)();
|
|
1026
|
+
app.use(import_express3.default.json());
|
|
1027
|
+
createExpressRouter({
|
|
1028
|
+
controllers,
|
|
1029
|
+
artifactsDir: absoluteArtifactsDir,
|
|
1030
|
+
middleware,
|
|
1031
|
+
auth,
|
|
1032
|
+
coerce
|
|
1033
|
+
}).then((router) => {
|
|
1013
1034
|
app.use(router);
|
|
1014
1035
|
if (enableSwagger) {
|
|
1015
1036
|
const displayHost = host === "0.0.0.0" ? "localhost" : host;
|
|
@@ -1056,9 +1077,7 @@ function bootstrap(options) {
|
|
|
1056
1077
|
reject(new Error(`Failed to start server: ${error.message}`));
|
|
1057
1078
|
}
|
|
1058
1079
|
});
|
|
1059
|
-
}
|
|
1060
|
-
reject(error);
|
|
1061
|
-
}
|
|
1080
|
+
}).catch(reject);
|
|
1062
1081
|
});
|
|
1063
1082
|
}
|
|
1064
1083
|
// Annotate the CommonJS export names for ESM import in node:
|