@forklaunch/express 0.10.9 → 0.10.11

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.
Files changed (3) hide show
  1. package/lib/index.js +75 -123
  2. package/lib/index.mjs +75 -123
  3. package/package.json +9 -9
package/lib/index.js CHANGED
@@ -41,11 +41,13 @@ var import_http33 = require("@forklaunch/core/http");
41
41
  // src/expressApplication.ts
42
42
  var import_common4 = require("@forklaunch/common");
43
43
  var import_http3 = require("@forklaunch/core/http");
44
+ var import_environment = require("@forklaunch/core/environment");
44
45
  var import_zod = require("@forklaunch/validator/zod");
45
46
  var import_express_api_reference = require("@scalar/express-api-reference");
46
47
  var import_crypto = __toESM(require("crypto"));
47
48
  var import_express2 = __toESM(require("express"));
48
49
  var import_fs = __toESM(require("fs"));
50
+ var import_path = __toESM(require("path"));
49
51
  var import_swagger_ui_express = __toESM(require("swagger-ui-express"));
50
52
 
51
53
  // src/cluster/bun.cluster.ts
@@ -635,66 +637,6 @@ function serveExpress(app, openTelemetryCollector, opts = {}) {
635
637
  [Symbol.asyncDispose]: async () => {
636
638
  cleanup();
637
639
  },
638
- // compose: (<T extends NodeJS.ReadableStream>(
639
- // stream:
640
- // | T
641
- // | ((source: unknown) => void)
642
- // | Iterable<T>
643
- // | AsyncIterable<T>
644
- // ): T => {
645
- // if (stream && typeof stream === 'object' && 'pipe' in stream) {
646
- // return stream as T;
647
- // }
648
- // if (typeof stream === 'function') {
649
- // const transform = new Transform({
650
- // objectMode: true,
651
- // transform(chunk, encoding, callback) {
652
- // try {
653
- // (stream as (source: unknown) => void)(chunk);
654
- // callback(null, chunk);
655
- // } catch (error) {
656
- // callback(error as Error);
657
- // }
658
- // }
659
- // });
660
- // return transform as unknown as T;
661
- // }
662
- // if (
663
- // stream &&
664
- // typeof stream === 'object' &&
665
- // Symbol.iterator in stream
666
- // ) {
667
- // const iterator = (stream as Iterable<unknown>)[Symbol.iterator]();
668
- // const first = iterator.next();
669
- // if (
670
- // !first.done &&
671
- // first.value &&
672
- // typeof first.value === 'object' &&
673
- // 'pipe' in first.value
674
- // ) {
675
- // return first.value as T;
676
- // }
677
- // }
678
- // if (
679
- // stream &&
680
- // typeof stream === 'object' &&
681
- // Symbol.asyncIterator in stream
682
- // ) {
683
- // const readable = new Readable({
684
- // objectMode: true,
685
- // read() {
686
- // this.push(null);
687
- // }
688
- // });
689
- // return readable as unknown as T;
690
- // }
691
- // const emptyStream = new Readable({
692
- // read() {
693
- // this.push(null);
694
- // }
695
- // }) as unknown as T;
696
- // return emptyStream;
697
- // }) as ExpressResponse['compose'],
698
640
  setTimeout: (msecs, callback) => {
699
641
  setTimeout(callback || (() => {
700
642
  }), msecs);
@@ -1144,13 +1086,13 @@ function serveExpress(app, openTelemetryCollector, opts = {}) {
1144
1086
  }
1145
1087
  return res;
1146
1088
  },
1147
- sendfile: function(path2, options2, callback) {
1089
+ sendfile: function(path3, options2, callback) {
1148
1090
  if (!callback && !options2) {
1149
- return res.sendFile(path2);
1091
+ return res.sendFile(path3);
1150
1092
  } else if (!callback && options2) {
1151
- return res.sendFile(path2, options2);
1093
+ return res.sendFile(path3, options2);
1152
1094
  } else if (callback && options2) {
1153
- return res.sendFile(path2, options2, callback);
1095
+ return res.sendFile(path3, options2, callback);
1154
1096
  }
1155
1097
  },
1156
1098
  attachment(filename) {
@@ -2100,8 +2042,18 @@ var Application = class extends import_http3.ForklaunchExpressLikeApplication {
2100
2042
  this,
2101
2043
  this.openapiConfiguration
2102
2044
  );
2045
+ const serviceName = process.env.OTEL_SERVICE_NAME || "unknown-service";
2046
+ const appRoot = (0, import_environment.findApplicationRoot)(process.cwd());
2047
+ const outputPath = process.env.FORKLAUNCH_OPENAPI_OUTPUT || import_path.default.join(
2048
+ appRoot,
2049
+ ".forklaunch",
2050
+ "openapi",
2051
+ serviceName,
2052
+ "openapi.json"
2053
+ );
2054
+ import_fs.default.mkdirSync(import_path.default.dirname(outputPath), { recursive: true });
2103
2055
  import_fs.default.writeFileSync(
2104
- process.env.FORKLAUNCH_OPENAPI_OUTPUT,
2056
+ outputPath,
2105
2057
  JSON.stringify(
2106
2058
  {
2107
2059
  ...openApiSpec,
@@ -2341,8 +2293,8 @@ var Router = class _Router extends import_http4.ForklaunchExpressLikeRouter {
2341
2293
  }
2342
2294
  // implements ForklaunchRouter<SV>
2343
2295
  configOptions;
2344
- route(path2) {
2345
- this.internal.route(path2);
2296
+ route(path3) {
2297
+ this.internal.route(path3);
2346
2298
  return this;
2347
2299
  }
2348
2300
  param(name, _types, handler) {
@@ -2523,170 +2475,170 @@ var Router = class _Router extends import_http4.ForklaunchExpressLikeRouter {
2523
2475
 
2524
2476
  // src/handlers/checkout.ts
2525
2477
  var import_http5 = require("@forklaunch/core/http");
2526
- var checkout = (schemaValidator, path2, contractDetails, ...handlers2) => {
2527
- return (0, import_http5.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2478
+ var checkout = (schemaValidator, path3, contractDetails, ...handlers2) => {
2479
+ return (0, import_http5.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2528
2480
  };
2529
2481
 
2530
2482
  // src/handlers/copy.ts
2531
2483
  var import_http6 = require("@forklaunch/core/http");
2532
- var copy = (schemaValidator, path2, contractDetails, ...handlers2) => {
2533
- return (0, import_http6.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2484
+ var copy = (schemaValidator, path3, contractDetails, ...handlers2) => {
2485
+ return (0, import_http6.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2534
2486
  };
2535
2487
 
2536
2488
  // src/handlers/delete.ts
2537
2489
  var import_http7 = require("@forklaunch/core/http");
2538
- var delete_ = (schemaValidator, path2, contractDetails, ...handlers2) => {
2539
- return (0, import_http7.delete_)(schemaValidator, path2, contractDetails, ...handlers2);
2490
+ var delete_ = (schemaValidator, path3, contractDetails, ...handlers2) => {
2491
+ return (0, import_http7.delete_)(schemaValidator, path3, contractDetails, ...handlers2);
2540
2492
  };
2541
2493
 
2542
2494
  // src/handlers/get.ts
2543
2495
  var import_http8 = require("@forklaunch/core/http");
2544
- var get = (schemaValidator, path2, contractDetails, ...handlers2) => {
2545
- return (0, import_http8.get)(schemaValidator, path2, contractDetails, ...handlers2);
2496
+ var get = (schemaValidator, path3, contractDetails, ...handlers2) => {
2497
+ return (0, import_http8.get)(schemaValidator, path3, contractDetails, ...handlers2);
2546
2498
  };
2547
2499
 
2548
2500
  // src/handlers/head.ts
2549
2501
  var import_http9 = require("@forklaunch/core/http");
2550
- var head = (schemaValidator, path2, contractDetails, ...handlers2) => {
2551
- return (0, import_http9.head)(schemaValidator, path2, contractDetails, ...handlers2);
2502
+ var head = (schemaValidator, path3, contractDetails, ...handlers2) => {
2503
+ return (0, import_http9.head)(schemaValidator, path3, contractDetails, ...handlers2);
2552
2504
  };
2553
2505
 
2554
2506
  // src/handlers/link.ts
2555
2507
  var import_http10 = require("@forklaunch/core/http");
2556
- var link = (schemaValidator, path2, contractDetails, ...handlers2) => {
2557
- return (0, import_http10.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2508
+ var link = (schemaValidator, path3, contractDetails, ...handlers2) => {
2509
+ return (0, import_http10.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2558
2510
  };
2559
2511
 
2560
2512
  // src/handlers/lock.ts
2561
2513
  var import_http11 = require("@forklaunch/core/http");
2562
- var lock = (schemaValidator, path2, contractDetails, ...handlers2) => {
2563
- return (0, import_http11.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2514
+ var lock = (schemaValidator, path3, contractDetails, ...handlers2) => {
2515
+ return (0, import_http11.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2564
2516
  };
2565
2517
 
2566
2518
  // src/handlers/m-search.ts
2567
2519
  var import_http12 = require("@forklaunch/core/http");
2568
- var mSearch = (schemaValidator, path2, contractDetails, ...handlers2) => {
2569
- return (0, import_http12.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2520
+ var mSearch = (schemaValidator, path3, contractDetails, ...handlers2) => {
2521
+ return (0, import_http12.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2570
2522
  };
2571
2523
 
2572
2524
  // src/handlers/merge.ts
2573
2525
  var import_http13 = require("@forklaunch/core/http");
2574
- var merge = (schemaValidator, path2, contractDetails, ...handlers2) => {
2575
- return (0, import_http13.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2526
+ var merge = (schemaValidator, path3, contractDetails, ...handlers2) => {
2527
+ return (0, import_http13.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2576
2528
  };
2577
2529
 
2578
2530
  // src/handlers/middleware.ts
2579
2531
  var import_http14 = require("@forklaunch/core/http");
2580
- var middleware7 = (schemaValidator, path2, contractDetails, ...handlers2) => {
2581
- return (0, import_http14.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2532
+ var middleware7 = (schemaValidator, path3, contractDetails, ...handlers2) => {
2533
+ return (0, import_http14.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2582
2534
  };
2583
2535
 
2584
2536
  // src/handlers/mkcactivity.ts
2585
2537
  var import_http15 = require("@forklaunch/core/http");
2586
- var mkcActivity = (schemaValidator, path2, contractDetails, ...handlers2) => {
2587
- return (0, import_http15.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2538
+ var mkcActivity = (schemaValidator, path3, contractDetails, ...handlers2) => {
2539
+ return (0, import_http15.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2588
2540
  };
2589
2541
 
2590
2542
  // src/handlers/mkcol.ts
2591
2543
  var import_http16 = require("@forklaunch/core/http");
2592
- var mkcol = (schemaValidator, path2, contractDetails, ...handlers2) => {
2593
- return (0, import_http16.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2544
+ var mkcol = (schemaValidator, path3, contractDetails, ...handlers2) => {
2545
+ return (0, import_http16.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2594
2546
  };
2595
2547
 
2596
2548
  // src/handlers/move.ts
2597
2549
  var import_http17 = require("@forklaunch/core/http");
2598
- var move = (schemaValidator, path2, contractDetails, ...handlers2) => {
2599
- return (0, import_http17.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2550
+ var move = (schemaValidator, path3, contractDetails, ...handlers2) => {
2551
+ return (0, import_http17.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2600
2552
  };
2601
2553
 
2602
2554
  // src/handlers/notify.ts
2603
2555
  var import_http18 = require("@forklaunch/core/http");
2604
- var notify = (schemaValidator, path2, contractDetails, ...handlers2) => {
2605
- return (0, import_http18.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2556
+ var notify = (schemaValidator, path3, contractDetails, ...handlers2) => {
2557
+ return (0, import_http18.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2606
2558
  };
2607
2559
 
2608
2560
  // src/handlers/options.ts
2609
2561
  var import_http19 = require("@forklaunch/core/http");
2610
- var options = (schemaValidator, path2, contractDetails, ...handlers2) => {
2611
- return (0, import_http19.options)(schemaValidator, path2, contractDetails, ...handlers2);
2562
+ var options = (schemaValidator, path3, contractDetails, ...handlers2) => {
2563
+ return (0, import_http19.options)(schemaValidator, path3, contractDetails, ...handlers2);
2612
2564
  };
2613
2565
 
2614
2566
  // src/handlers/patch.ts
2615
2567
  var import_http20 = require("@forklaunch/core/http");
2616
- var patch = (schemaValidator, path2, contractDetails, ...handlers2) => {
2617
- return (0, import_http20.patch)(schemaValidator, path2, contractDetails, ...handlers2);
2568
+ var patch = (schemaValidator, path3, contractDetails, ...handlers2) => {
2569
+ return (0, import_http20.patch)(schemaValidator, path3, contractDetails, ...handlers2);
2618
2570
  };
2619
2571
 
2620
2572
  // src/handlers/post.ts
2621
2573
  var import_http21 = require("@forklaunch/core/http");
2622
- var post = (schemaValidator, path2, contractDetails, ...handlers2) => {
2623
- return (0, import_http21.post)(schemaValidator, path2, contractDetails, ...handlers2);
2574
+ var post = (schemaValidator, path3, contractDetails, ...handlers2) => {
2575
+ return (0, import_http21.post)(schemaValidator, path3, contractDetails, ...handlers2);
2624
2576
  };
2625
2577
 
2626
2578
  // src/handlers/propfind.ts
2627
2579
  var import_http22 = require("@forklaunch/core/http");
2628
- var propfind = (schemaValidator, path2, contractDetails, ...handlers2) => {
2629
- return (0, import_http22.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2580
+ var propfind = (schemaValidator, path3, contractDetails, ...handlers2) => {
2581
+ return (0, import_http22.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2630
2582
  };
2631
2583
 
2632
2584
  // src/handlers/proppatch.ts
2633
2585
  var import_http23 = require("@forklaunch/core/http");
2634
- var proppatch = (schemaValidator, path2, contractDetails, ...handlers2) => {
2635
- return (0, import_http23.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2586
+ var proppatch = (schemaValidator, path3, contractDetails, ...handlers2) => {
2587
+ return (0, import_http23.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2636
2588
  };
2637
2589
 
2638
2590
  // src/handlers/purge.ts
2639
2591
  var import_http24 = require("@forklaunch/core/http");
2640
- var purge = (schemaValidator, path2, contractDetails, ...handlers2) => {
2641
- return (0, import_http24.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2592
+ var purge = (schemaValidator, path3, contractDetails, ...handlers2) => {
2593
+ return (0, import_http24.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2642
2594
  };
2643
2595
 
2644
2596
  // src/handlers/put.ts
2645
2597
  var import_http25 = require("@forklaunch/core/http");
2646
- var put = (schemaValidator, path2, contractDetails, ...handlers2) => {
2647
- return (0, import_http25.put)(schemaValidator, path2, contractDetails, ...handlers2);
2598
+ var put = (schemaValidator, path3, contractDetails, ...handlers2) => {
2599
+ return (0, import_http25.put)(schemaValidator, path3, contractDetails, ...handlers2);
2648
2600
  };
2649
2601
 
2650
2602
  // src/handlers/report.ts
2651
2603
  var import_http26 = require("@forklaunch/core/http");
2652
- var report = (schemaValidator, path2, contractDetails, ...handlers2) => {
2653
- return (0, import_http26.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2604
+ var report = (schemaValidator, path3, contractDetails, ...handlers2) => {
2605
+ return (0, import_http26.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2654
2606
  };
2655
2607
 
2656
2608
  // src/handlers/search.ts
2657
2609
  var import_http27 = require("@forklaunch/core/http");
2658
- var search = (schemaValidator, path2, contractDetails, ...handlers2) => {
2659
- return (0, import_http27.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2610
+ var search = (schemaValidator, path3, contractDetails, ...handlers2) => {
2611
+ return (0, import_http27.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2660
2612
  };
2661
2613
 
2662
2614
  // src/handlers/subscribe.ts
2663
2615
  var import_http28 = require("@forklaunch/core/http");
2664
- var subscribe = (schemaValidator, path2, contractDetails, ...handlers2) => {
2665
- return (0, import_http28.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2616
+ var subscribe = (schemaValidator, path3, contractDetails, ...handlers2) => {
2617
+ return (0, import_http28.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2666
2618
  };
2667
2619
 
2668
2620
  // src/handlers/trace.ts
2669
2621
  var import_http29 = require("@forklaunch/core/http");
2670
- var trace = (schemaValidator, path2, contractDetails, ...handlers2) => {
2671
- return (0, import_http29.trace)(schemaValidator, path2, contractDetails, ...handlers2);
2622
+ var trace = (schemaValidator, path3, contractDetails, ...handlers2) => {
2623
+ return (0, import_http29.trace)(schemaValidator, path3, contractDetails, ...handlers2);
2672
2624
  };
2673
2625
 
2674
2626
  // src/handlers/unlink.ts
2675
2627
  var import_http30 = require("@forklaunch/core/http");
2676
- var unlink = (schemaValidator, path2, contractDetails, ...handlers2) => {
2677
- return (0, import_http30.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2628
+ var unlink = (schemaValidator, path3, contractDetails, ...handlers2) => {
2629
+ return (0, import_http30.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2678
2630
  };
2679
2631
 
2680
2632
  // src/handlers/unlock.ts
2681
2633
  var import_http31 = require("@forklaunch/core/http");
2682
- var unlock = (schemaValidator, path2, contractDetails, ...handlers2) => {
2683
- return (0, import_http31.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2634
+ var unlock = (schemaValidator, path3, contractDetails, ...handlers2) => {
2635
+ return (0, import_http31.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2684
2636
  };
2685
2637
 
2686
2638
  // src/handlers/unsubscribe.ts
2687
2639
  var import_http32 = require("@forklaunch/core/http");
2688
- var unsubscribe = (schemaValidator, path2, contractDetails, ...handlers2) => {
2689
- return (0, import_http32.middleware)(schemaValidator, path2, contractDetails, ...handlers2);
2640
+ var unsubscribe = (schemaValidator, path3, contractDetails, ...handlers2) => {
2641
+ return (0, import_http32.middleware)(schemaValidator, path3, contractDetails, ...handlers2);
2690
2642
  };
2691
2643
 
2692
2644
  // index.ts
package/lib/index.mjs CHANGED
@@ -15,11 +15,13 @@ import {
15
15
  meta,
16
16
  OPENAPI_DEFAULT_VERSION
17
17
  } from "@forklaunch/core/http";
18
+ import { findApplicationRoot } from "@forklaunch/core/environment";
18
19
  import { ZodSchemaValidator } from "@forklaunch/validator/zod";
19
20
  import { apiReference } from "@scalar/express-api-reference";
20
21
  import crypto2 from "crypto";
21
22
  import express2 from "express";
22
23
  import fs2 from "fs";
24
+ import path2 from "path";
23
25
  import swaggerUi from "swagger-ui-express";
24
26
 
25
27
  // src/cluster/bun.cluster.ts
@@ -609,66 +611,6 @@ function serveExpress(app, openTelemetryCollector, opts = {}) {
609
611
  [Symbol.asyncDispose]: async () => {
610
612
  cleanup();
611
613
  },
612
- // compose: (<T extends NodeJS.ReadableStream>(
613
- // stream:
614
- // | T
615
- // | ((source: unknown) => void)
616
- // | Iterable<T>
617
- // | AsyncIterable<T>
618
- // ): T => {
619
- // if (stream && typeof stream === 'object' && 'pipe' in stream) {
620
- // return stream as T;
621
- // }
622
- // if (typeof stream === 'function') {
623
- // const transform = new Transform({
624
- // objectMode: true,
625
- // transform(chunk, encoding, callback) {
626
- // try {
627
- // (stream as (source: unknown) => void)(chunk);
628
- // callback(null, chunk);
629
- // } catch (error) {
630
- // callback(error as Error);
631
- // }
632
- // }
633
- // });
634
- // return transform as unknown as T;
635
- // }
636
- // if (
637
- // stream &&
638
- // typeof stream === 'object' &&
639
- // Symbol.iterator in stream
640
- // ) {
641
- // const iterator = (stream as Iterable<unknown>)[Symbol.iterator]();
642
- // const first = iterator.next();
643
- // if (
644
- // !first.done &&
645
- // first.value &&
646
- // typeof first.value === 'object' &&
647
- // 'pipe' in first.value
648
- // ) {
649
- // return first.value as T;
650
- // }
651
- // }
652
- // if (
653
- // stream &&
654
- // typeof stream === 'object' &&
655
- // Symbol.asyncIterator in stream
656
- // ) {
657
- // const readable = new Readable({
658
- // objectMode: true,
659
- // read() {
660
- // this.push(null);
661
- // }
662
- // });
663
- // return readable as unknown as T;
664
- // }
665
- // const emptyStream = new Readable({
666
- // read() {
667
- // this.push(null);
668
- // }
669
- // }) as unknown as T;
670
- // return emptyStream;
671
- // }) as ExpressResponse['compose'],
672
614
  setTimeout: (msecs, callback) => {
673
615
  setTimeout(callback || (() => {
674
616
  }), msecs);
@@ -1118,13 +1060,13 @@ function serveExpress(app, openTelemetryCollector, opts = {}) {
1118
1060
  }
1119
1061
  return res;
1120
1062
  },
1121
- sendfile: function(path2, options2, callback) {
1063
+ sendfile: function(path3, options2, callback) {
1122
1064
  if (!callback && !options2) {
1123
- return res.sendFile(path2);
1065
+ return res.sendFile(path3);
1124
1066
  } else if (!callback && options2) {
1125
- return res.sendFile(path2, options2);
1067
+ return res.sendFile(path3, options2);
1126
1068
  } else if (callback && options2) {
1127
- return res.sendFile(path2, options2, callback);
1069
+ return res.sendFile(path3, options2, callback);
1128
1070
  }
1129
1071
  },
1130
1072
  attachment(filename) {
@@ -2076,8 +2018,18 @@ var Application = class extends ForklaunchExpressLikeApplication {
2076
2018
  this,
2077
2019
  this.openapiConfiguration
2078
2020
  );
2021
+ const serviceName = process.env.OTEL_SERVICE_NAME || "unknown-service";
2022
+ const appRoot = findApplicationRoot(process.cwd());
2023
+ const outputPath = process.env.FORKLAUNCH_OPENAPI_OUTPUT || path2.join(
2024
+ appRoot,
2025
+ ".forklaunch",
2026
+ "openapi",
2027
+ serviceName,
2028
+ "openapi.json"
2029
+ );
2030
+ fs2.mkdirSync(path2.dirname(outputPath), { recursive: true });
2079
2031
  fs2.writeFileSync(
2080
- process.env.FORKLAUNCH_OPENAPI_OUTPUT,
2032
+ outputPath,
2081
2033
  JSON.stringify(
2082
2034
  {
2083
2035
  ...openApiSpec,
@@ -2319,8 +2271,8 @@ var Router = class _Router extends ForklaunchExpressLikeRouter {
2319
2271
  }
2320
2272
  // implements ForklaunchRouter<SV>
2321
2273
  configOptions;
2322
- route(path2) {
2323
- this.internal.route(path2);
2274
+ route(path3) {
2275
+ this.internal.route(path3);
2324
2276
  return this;
2325
2277
  }
2326
2278
  param(name, _types, handler) {
@@ -2503,224 +2455,224 @@ var Router = class _Router extends ForklaunchExpressLikeRouter {
2503
2455
  import {
2504
2456
  middleware
2505
2457
  } from "@forklaunch/core/http";
2506
- var checkout = (schemaValidator, path2, contractDetails, ...handlers2) => {
2507
- return middleware(schemaValidator, path2, contractDetails, ...handlers2);
2458
+ var checkout = (schemaValidator, path3, contractDetails, ...handlers2) => {
2459
+ return middleware(schemaValidator, path3, contractDetails, ...handlers2);
2508
2460
  };
2509
2461
 
2510
2462
  // src/handlers/copy.ts
2511
2463
  import {
2512
2464
  middleware as middleware2
2513
2465
  } from "@forklaunch/core/http";
2514
- var copy = (schemaValidator, path2, contractDetails, ...handlers2) => {
2515
- return middleware2(schemaValidator, path2, contractDetails, ...handlers2);
2466
+ var copy = (schemaValidator, path3, contractDetails, ...handlers2) => {
2467
+ return middleware2(schemaValidator, path3, contractDetails, ...handlers2);
2516
2468
  };
2517
2469
 
2518
2470
  // src/handlers/delete.ts
2519
2471
  import {
2520
2472
  delete_ as innerDelete
2521
2473
  } from "@forklaunch/core/http";
2522
- var delete_ = (schemaValidator, path2, contractDetails, ...handlers2) => {
2523
- return innerDelete(schemaValidator, path2, contractDetails, ...handlers2);
2474
+ var delete_ = (schemaValidator, path3, contractDetails, ...handlers2) => {
2475
+ return innerDelete(schemaValidator, path3, contractDetails, ...handlers2);
2524
2476
  };
2525
2477
 
2526
2478
  // src/handlers/get.ts
2527
2479
  import {
2528
2480
  get as innerGet
2529
2481
  } from "@forklaunch/core/http";
2530
- var get = (schemaValidator, path2, contractDetails, ...handlers2) => {
2531
- return innerGet(schemaValidator, path2, contractDetails, ...handlers2);
2482
+ var get = (schemaValidator, path3, contractDetails, ...handlers2) => {
2483
+ return innerGet(schemaValidator, path3, contractDetails, ...handlers2);
2532
2484
  };
2533
2485
 
2534
2486
  // src/handlers/head.ts
2535
2487
  import {
2536
2488
  head as innerHead
2537
2489
  } from "@forklaunch/core/http";
2538
- var head = (schemaValidator, path2, contractDetails, ...handlers2) => {
2539
- return innerHead(schemaValidator, path2, contractDetails, ...handlers2);
2490
+ var head = (schemaValidator, path3, contractDetails, ...handlers2) => {
2491
+ return innerHead(schemaValidator, path3, contractDetails, ...handlers2);
2540
2492
  };
2541
2493
 
2542
2494
  // src/handlers/link.ts
2543
2495
  import {
2544
2496
  middleware as middleware3
2545
2497
  } from "@forklaunch/core/http";
2546
- var link = (schemaValidator, path2, contractDetails, ...handlers2) => {
2547
- return middleware3(schemaValidator, path2, contractDetails, ...handlers2);
2498
+ var link = (schemaValidator, path3, contractDetails, ...handlers2) => {
2499
+ return middleware3(schemaValidator, path3, contractDetails, ...handlers2);
2548
2500
  };
2549
2501
 
2550
2502
  // src/handlers/lock.ts
2551
2503
  import {
2552
2504
  middleware as middleware4
2553
2505
  } from "@forklaunch/core/http";
2554
- var lock = (schemaValidator, path2, contractDetails, ...handlers2) => {
2555
- return middleware4(schemaValidator, path2, contractDetails, ...handlers2);
2506
+ var lock = (schemaValidator, path3, contractDetails, ...handlers2) => {
2507
+ return middleware4(schemaValidator, path3, contractDetails, ...handlers2);
2556
2508
  };
2557
2509
 
2558
2510
  // src/handlers/m-search.ts
2559
2511
  import {
2560
2512
  middleware as middleware5
2561
2513
  } from "@forklaunch/core/http";
2562
- var mSearch = (schemaValidator, path2, contractDetails, ...handlers2) => {
2563
- return middleware5(schemaValidator, path2, contractDetails, ...handlers2);
2514
+ var mSearch = (schemaValidator, path3, contractDetails, ...handlers2) => {
2515
+ return middleware5(schemaValidator, path3, contractDetails, ...handlers2);
2564
2516
  };
2565
2517
 
2566
2518
  // src/handlers/merge.ts
2567
2519
  import {
2568
2520
  middleware as middleware6
2569
2521
  } from "@forklaunch/core/http";
2570
- var merge = (schemaValidator, path2, contractDetails, ...handlers2) => {
2571
- return middleware6(schemaValidator, path2, contractDetails, ...handlers2);
2522
+ var merge = (schemaValidator, path3, contractDetails, ...handlers2) => {
2523
+ return middleware6(schemaValidator, path3, contractDetails, ...handlers2);
2572
2524
  };
2573
2525
 
2574
2526
  // src/handlers/middleware.ts
2575
2527
  import {
2576
2528
  middleware as innerMiddleware
2577
2529
  } from "@forklaunch/core/http";
2578
- var middleware7 = (schemaValidator, path2, contractDetails, ...handlers2) => {
2579
- return innerMiddleware(schemaValidator, path2, contractDetails, ...handlers2);
2530
+ var middleware7 = (schemaValidator, path3, contractDetails, ...handlers2) => {
2531
+ return innerMiddleware(schemaValidator, path3, contractDetails, ...handlers2);
2580
2532
  };
2581
2533
 
2582
2534
  // src/handlers/mkcactivity.ts
2583
2535
  import {
2584
2536
  middleware as middleware8
2585
2537
  } from "@forklaunch/core/http";
2586
- var mkcActivity = (schemaValidator, path2, contractDetails, ...handlers2) => {
2587
- return middleware8(schemaValidator, path2, contractDetails, ...handlers2);
2538
+ var mkcActivity = (schemaValidator, path3, contractDetails, ...handlers2) => {
2539
+ return middleware8(schemaValidator, path3, contractDetails, ...handlers2);
2588
2540
  };
2589
2541
 
2590
2542
  // src/handlers/mkcol.ts
2591
2543
  import {
2592
2544
  middleware as middleware9
2593
2545
  } from "@forklaunch/core/http";
2594
- var mkcol = (schemaValidator, path2, contractDetails, ...handlers2) => {
2595
- return middleware9(schemaValidator, path2, contractDetails, ...handlers2);
2546
+ var mkcol = (schemaValidator, path3, contractDetails, ...handlers2) => {
2547
+ return middleware9(schemaValidator, path3, contractDetails, ...handlers2);
2596
2548
  };
2597
2549
 
2598
2550
  // src/handlers/move.ts
2599
2551
  import {
2600
2552
  middleware as middleware10
2601
2553
  } from "@forklaunch/core/http";
2602
- var move = (schemaValidator, path2, contractDetails, ...handlers2) => {
2603
- return middleware10(schemaValidator, path2, contractDetails, ...handlers2);
2554
+ var move = (schemaValidator, path3, contractDetails, ...handlers2) => {
2555
+ return middleware10(schemaValidator, path3, contractDetails, ...handlers2);
2604
2556
  };
2605
2557
 
2606
2558
  // src/handlers/notify.ts
2607
2559
  import {
2608
2560
  middleware as middleware11
2609
2561
  } from "@forklaunch/core/http";
2610
- var notify = (schemaValidator, path2, contractDetails, ...handlers2) => {
2611
- return middleware11(schemaValidator, path2, contractDetails, ...handlers2);
2562
+ var notify = (schemaValidator, path3, contractDetails, ...handlers2) => {
2563
+ return middleware11(schemaValidator, path3, contractDetails, ...handlers2);
2612
2564
  };
2613
2565
 
2614
2566
  // src/handlers/options.ts
2615
2567
  import {
2616
2568
  options as innerOptions
2617
2569
  } from "@forklaunch/core/http";
2618
- var options = (schemaValidator, path2, contractDetails, ...handlers2) => {
2619
- return innerOptions(schemaValidator, path2, contractDetails, ...handlers2);
2570
+ var options = (schemaValidator, path3, contractDetails, ...handlers2) => {
2571
+ return innerOptions(schemaValidator, path3, contractDetails, ...handlers2);
2620
2572
  };
2621
2573
 
2622
2574
  // src/handlers/patch.ts
2623
2575
  import {
2624
2576
  patch as innerPatch
2625
2577
  } from "@forklaunch/core/http";
2626
- var patch = (schemaValidator, path2, contractDetails, ...handlers2) => {
2627
- return innerPatch(schemaValidator, path2, contractDetails, ...handlers2);
2578
+ var patch = (schemaValidator, path3, contractDetails, ...handlers2) => {
2579
+ return innerPatch(schemaValidator, path3, contractDetails, ...handlers2);
2628
2580
  };
2629
2581
 
2630
2582
  // src/handlers/post.ts
2631
2583
  import {
2632
2584
  post as innerPost
2633
2585
  } from "@forklaunch/core/http";
2634
- var post = (schemaValidator, path2, contractDetails, ...handlers2) => {
2635
- return innerPost(schemaValidator, path2, contractDetails, ...handlers2);
2586
+ var post = (schemaValidator, path3, contractDetails, ...handlers2) => {
2587
+ return innerPost(schemaValidator, path3, contractDetails, ...handlers2);
2636
2588
  };
2637
2589
 
2638
2590
  // src/handlers/propfind.ts
2639
2591
  import {
2640
2592
  middleware as middleware12
2641
2593
  } from "@forklaunch/core/http";
2642
- var propfind = (schemaValidator, path2, contractDetails, ...handlers2) => {
2643
- return middleware12(schemaValidator, path2, contractDetails, ...handlers2);
2594
+ var propfind = (schemaValidator, path3, contractDetails, ...handlers2) => {
2595
+ return middleware12(schemaValidator, path3, contractDetails, ...handlers2);
2644
2596
  };
2645
2597
 
2646
2598
  // src/handlers/proppatch.ts
2647
2599
  import {
2648
2600
  middleware as middleware13
2649
2601
  } from "@forklaunch/core/http";
2650
- var proppatch = (schemaValidator, path2, contractDetails, ...handlers2) => {
2651
- return middleware13(schemaValidator, path2, contractDetails, ...handlers2);
2602
+ var proppatch = (schemaValidator, path3, contractDetails, ...handlers2) => {
2603
+ return middleware13(schemaValidator, path3, contractDetails, ...handlers2);
2652
2604
  };
2653
2605
 
2654
2606
  // src/handlers/purge.ts
2655
2607
  import {
2656
2608
  middleware as middleware14
2657
2609
  } from "@forklaunch/core/http";
2658
- var purge = (schemaValidator, path2, contractDetails, ...handlers2) => {
2659
- return middleware14(schemaValidator, path2, contractDetails, ...handlers2);
2610
+ var purge = (schemaValidator, path3, contractDetails, ...handlers2) => {
2611
+ return middleware14(schemaValidator, path3, contractDetails, ...handlers2);
2660
2612
  };
2661
2613
 
2662
2614
  // src/handlers/put.ts
2663
2615
  import {
2664
2616
  put as innerPut
2665
2617
  } from "@forklaunch/core/http";
2666
- var put = (schemaValidator, path2, contractDetails, ...handlers2) => {
2667
- return innerPut(schemaValidator, path2, contractDetails, ...handlers2);
2618
+ var put = (schemaValidator, path3, contractDetails, ...handlers2) => {
2619
+ return innerPut(schemaValidator, path3, contractDetails, ...handlers2);
2668
2620
  };
2669
2621
 
2670
2622
  // src/handlers/report.ts
2671
2623
  import {
2672
2624
  middleware as middleware15
2673
2625
  } from "@forklaunch/core/http";
2674
- var report = (schemaValidator, path2, contractDetails, ...handlers2) => {
2675
- return middleware15(schemaValidator, path2, contractDetails, ...handlers2);
2626
+ var report = (schemaValidator, path3, contractDetails, ...handlers2) => {
2627
+ return middleware15(schemaValidator, path3, contractDetails, ...handlers2);
2676
2628
  };
2677
2629
 
2678
2630
  // src/handlers/search.ts
2679
2631
  import {
2680
2632
  middleware as middleware16
2681
2633
  } from "@forklaunch/core/http";
2682
- var search = (schemaValidator, path2, contractDetails, ...handlers2) => {
2683
- return middleware16(schemaValidator, path2, contractDetails, ...handlers2);
2634
+ var search = (schemaValidator, path3, contractDetails, ...handlers2) => {
2635
+ return middleware16(schemaValidator, path3, contractDetails, ...handlers2);
2684
2636
  };
2685
2637
 
2686
2638
  // src/handlers/subscribe.ts
2687
2639
  import {
2688
2640
  middleware as middleware17
2689
2641
  } from "@forklaunch/core/http";
2690
- var subscribe = (schemaValidator, path2, contractDetails, ...handlers2) => {
2691
- return middleware17(schemaValidator, path2, contractDetails, ...handlers2);
2642
+ var subscribe = (schemaValidator, path3, contractDetails, ...handlers2) => {
2643
+ return middleware17(schemaValidator, path3, contractDetails, ...handlers2);
2692
2644
  };
2693
2645
 
2694
2646
  // src/handlers/trace.ts
2695
2647
  import {
2696
2648
  trace as innerTrace
2697
2649
  } from "@forklaunch/core/http";
2698
- var trace = (schemaValidator, path2, contractDetails, ...handlers2) => {
2699
- return innerTrace(schemaValidator, path2, contractDetails, ...handlers2);
2650
+ var trace = (schemaValidator, path3, contractDetails, ...handlers2) => {
2651
+ return innerTrace(schemaValidator, path3, contractDetails, ...handlers2);
2700
2652
  };
2701
2653
 
2702
2654
  // src/handlers/unlink.ts
2703
2655
  import {
2704
2656
  middleware as middleware18
2705
2657
  } from "@forklaunch/core/http";
2706
- var unlink = (schemaValidator, path2, contractDetails, ...handlers2) => {
2707
- return middleware18(schemaValidator, path2, contractDetails, ...handlers2);
2658
+ var unlink = (schemaValidator, path3, contractDetails, ...handlers2) => {
2659
+ return middleware18(schemaValidator, path3, contractDetails, ...handlers2);
2708
2660
  };
2709
2661
 
2710
2662
  // src/handlers/unlock.ts
2711
2663
  import {
2712
2664
  middleware as middleware19
2713
2665
  } from "@forklaunch/core/http";
2714
- var unlock = (schemaValidator, path2, contractDetails, ...handlers2) => {
2715
- return middleware19(schemaValidator, path2, contractDetails, ...handlers2);
2666
+ var unlock = (schemaValidator, path3, contractDetails, ...handlers2) => {
2667
+ return middleware19(schemaValidator, path3, contractDetails, ...handlers2);
2716
2668
  };
2717
2669
 
2718
2670
  // src/handlers/unsubscribe.ts
2719
2671
  import {
2720
2672
  middleware as middleware20
2721
2673
  } from "@forklaunch/core/http";
2722
- var unsubscribe = (schemaValidator, path2, contractDetails, ...handlers2) => {
2723
- return middleware20(schemaValidator, path2, contractDetails, ...handlers2);
2674
+ var unsubscribe = (schemaValidator, path3, contractDetails, ...handlers2) => {
2675
+ return middleware20(schemaValidator, path3, contractDetails, ...handlers2);
2724
2676
  };
2725
2677
 
2726
2678
  // index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/express",
3
- "version": "0.10.9",
3
+ "version": "0.10.11",
4
4
  "description": "Forklaunch framework for express.",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@modelcontextprotocol/sdk": "^1.27.1",
29
- "@scalar/express-api-reference": "^0.9.0",
29
+ "@scalar/express-api-reference": "^0.9.2",
30
30
  "@types/multer": "^2.1.0",
31
31
  "body-parser": "^2.2.2",
32
32
  "busboy": "^1.6.0",
@@ -37,9 +37,9 @@
37
37
  "qs": "^6.15.0",
38
38
  "range-parser": "^1.2.1",
39
39
  "swagger-ui-express": "^5.0.1",
40
- "@forklaunch/common": "0.6.32",
41
- "@forklaunch/validator": "0.10.32",
42
- "@forklaunch/core": "0.18.5"
40
+ "@forklaunch/core": "0.18.7",
41
+ "@forklaunch/common": "0.6.34",
42
+ "@forklaunch/validator": "0.10.34"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@eslint/js": "^10.0.1",
@@ -50,12 +50,12 @@
50
50
  "@types/express": "^5.0.6",
51
51
  "@types/express-serve-static-core": "^5.1.1",
52
52
  "@types/jest": "^30.0.0",
53
- "@types/node": "^25.3.5",
53
+ "@types/node": "^25.4.0",
54
54
  "@types/qs": "^6.15.0",
55
55
  "@types/range-parser": "^1.2.7",
56
56
  "@types/swagger-ui-express": "^4.1.8",
57
- "@typescript/native-preview": "7.0.0-dev.20260306.1",
58
- "jest": "^30.2.0",
57
+ "@typescript/native-preview": "7.0.0-dev.20260311.1",
58
+ "jest": "^30.3.0",
59
59
  "kill-port-process": "^4.0.2",
60
60
  "prettier": "^3.8.1",
61
61
  "ts-jest": "^29.4.6",
@@ -63,7 +63,7 @@
63
63
  "tsup": "^8.5.1",
64
64
  "typedoc": "^0.28.17",
65
65
  "typescript": "^5.9.3",
66
- "typescript-eslint": "^8.56.1"
66
+ "typescript-eslint": "^8.57.0"
67
67
  },
68
68
  "scripts": {
69
69
  "build": "tsgo --noEmit && tsup index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --dts --clean",