@nexusts/openapi 0.9.6 → 0.9.8
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/decorators/body.d.ts +3 -1
- package/dist/decorators/operation.d.ts +3 -1
- package/dist/decorators/param.d.ts +7 -9
- package/dist/decorators/response.d.ts +3 -1
- package/dist/decorators/standard-meta.d.ts +8 -0
- package/dist/index.js +118 -54
- package/dist/index.js.map +11 -10
- package/dist/openapi.service.d.ts +4 -2
- package/dist/types.d.ts +0 -1
- package/package.json +2 -2
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* `@ApiBody({ description, required, schema })` — document the request
|
|
3
3
|
* body. Auto-derivation from `@Validate({ body })` runs first; explicit
|
|
4
4
|
* `@ApiBody` decorators take precedence.
|
|
5
|
+
*
|
|
6
|
+
* Dual-mode: supports TC39 standard ES decorators + legacy.
|
|
5
7
|
*/
|
|
6
8
|
import { type ApiBodyOptions } from "../types.js";
|
|
7
|
-
export declare function ApiBody(options: ApiBodyOptions):
|
|
9
|
+
export declare function ApiBody(options: ApiBodyOptions): any;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* `@ApiOperation({ summary, description, operationId, tags, deprecated })`
|
|
3
3
|
*
|
|
4
4
|
* Decorate a controller method to describe the operation in the spec.
|
|
5
|
+
*
|
|
6
|
+
* Dual-mode: supports TC39 standard ES decorators + legacy.
|
|
5
7
|
*/
|
|
6
8
|
import { type ApiOperationOptions } from "../types.js";
|
|
7
|
-
export declare function ApiOperation(options: ApiOperationOptions):
|
|
9
|
+
export declare function ApiOperation(options: ApiOperationOptions): any;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@ApiParam({ name, description, required, schema })` — document a
|
|
3
3
|
* path parameter. The decorator is optional — the spec builder
|
|
4
|
-
* auto-derives path params from
|
|
4
|
+
* auto-derives path params from route patterns (`/users/:id` → `id`).
|
|
5
5
|
* Use this when you want to override the schema or add a description.
|
|
6
|
-
*/
|
|
7
|
-
import { type ApiParamOptions } from "../types.js";
|
|
8
|
-
export declare function ApiParam(options: ApiParamOptions): MethodDecorator;
|
|
9
|
-
/**
|
|
10
|
-
* `@ApiQuery({ name: 'q', description: '...', schema: z.string() })`
|
|
11
6
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* `@ApiQuery({ name, description, schema })` — document a query param.
|
|
8
|
+
*
|
|
9
|
+
* Both are dual-mode (TC39 standard + legacy).
|
|
14
10
|
*/
|
|
15
|
-
|
|
11
|
+
import { type ApiParamOptions } from "../types.js";
|
|
12
|
+
export declare const ApiParam: (options: ApiParamOptions) => any;
|
|
13
|
+
export declare const ApiQuery: (options: ApiParamOptions) => any;
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Decorate a controller method to describe one of its responses.
|
|
5
5
|
* Multiple `@ApiResponse` calls accumulate.
|
|
6
|
+
*
|
|
7
|
+
* Dual-mode: supports TC39 standard ES decorators + legacy.
|
|
6
8
|
*/
|
|
7
9
|
import { type ApiResponseOptions } from "../types.js";
|
|
8
|
-
export declare function ApiResponse(status: number | string, options: ApiResponseOptions):
|
|
10
|
+
export declare function ApiResponse(status: number | string, options: ApiResponseOptions): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store metadata in standard mode — stashes on the function.
|
|
3
|
+
*/
|
|
4
|
+
export declare function storeMethodMetaStandard(fn: any, metaKey: string, value: unknown): void;
|
|
5
|
+
/**
|
|
6
|
+
* Read metadata that may have been stored via standard or legacy mode.
|
|
7
|
+
*/
|
|
8
|
+
export declare function readMethodMeta<T>(metaKey: string, ctor: any, propKey: string | symbol): T | undefined;
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,6 @@ var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
|
36
36
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
37
37
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
38
38
|
};
|
|
39
|
-
var __legacyDecorateParamTS = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
40
39
|
var __legacyMetadataTS = (k, v) => {
|
|
41
40
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
42
41
|
return Reflect.metadata(k, v);
|
|
@@ -415,14 +414,45 @@ function safeCall(fn) {
|
|
|
415
414
|
}
|
|
416
415
|
|
|
417
416
|
// packages/openapi/src/openapi.service.ts
|
|
417
|
+
import { safeGetMeta as safeGetMeta2 } from "@nexusts/core/di/safe-reflect";
|
|
418
|
+
|
|
419
|
+
// packages/openapi/src/decorators/standard-meta.ts
|
|
418
420
|
import { safeGetMeta } from "@nexusts/core/di/safe-reflect";
|
|
421
|
+
var FN_META_KEY = Symbol.for("nexus:openapi:fn:meta");
|
|
422
|
+
function storeMethodMetaStandard(fn, metaKey, value) {
|
|
423
|
+
if (!fn[FN_META_KEY])
|
|
424
|
+
fn[FN_META_KEY] = {};
|
|
425
|
+
fn[FN_META_KEY][metaKey] = value;
|
|
426
|
+
}
|
|
427
|
+
function readMethodMeta(metaKey, ctor, propKey) {
|
|
428
|
+
if (ctor && typeof ctor === "function") {
|
|
429
|
+
try {
|
|
430
|
+
const fromLegacy = safeGetMeta(metaKey, ctor, propKey);
|
|
431
|
+
if (fromLegacy !== undefined)
|
|
432
|
+
return fromLegacy;
|
|
433
|
+
} catch {}
|
|
434
|
+
}
|
|
435
|
+
if (ctor?.prototype) {
|
|
436
|
+
const fn = ctor.prototype[propKey];
|
|
437
|
+
if (typeof fn === "function") {
|
|
438
|
+
const stashed = fn[FN_META_KEY]?.[metaKey];
|
|
439
|
+
if (stashed !== undefined)
|
|
440
|
+
return stashed;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// packages/openapi/src/openapi.service.ts
|
|
419
447
|
class OpenAPIService {
|
|
420
448
|
static TOKEN = Symbol.for("nexus:OpenAPIService");
|
|
421
449
|
#config;
|
|
422
450
|
#components = { schemas: new Map };
|
|
423
451
|
#routes = [];
|
|
424
|
-
constructor(
|
|
425
|
-
this.#config
|
|
452
|
+
constructor() {
|
|
453
|
+
if (!this.#config) {
|
|
454
|
+
this.#config = this._injectConfig ?? { info: { title: "API", version: "0.0.0" } };
|
|
455
|
+
}
|
|
426
456
|
}
|
|
427
457
|
setRoutes(routes) {
|
|
428
458
|
this.#routes = routes;
|
|
@@ -433,7 +463,7 @@ class OpenAPIService {
|
|
|
433
463
|
getSpec() {
|
|
434
464
|
const paths = {};
|
|
435
465
|
for (const route of this.#routes) {
|
|
436
|
-
if (
|
|
466
|
+
if (safeGetMeta2(OPENAPI_META.EXCLUDE, route.target.constructor, route.propertyKey))
|
|
437
467
|
continue;
|
|
438
468
|
const op = this.buildOperation(route);
|
|
439
469
|
const normalized = this.normalizePath(route.path);
|
|
@@ -463,14 +493,14 @@ class OpenAPIService {
|
|
|
463
493
|
buildOperation(route) {
|
|
464
494
|
const ctor = route.target.constructor ?? route.target;
|
|
465
495
|
const propKey = route.propertyKey;
|
|
466
|
-
const classTags =
|
|
467
|
-
const opMeta =
|
|
496
|
+
const classTags = safeGetMeta2(OPENAPI_META.TAGS, ctor) ?? [];
|
|
497
|
+
const opMeta = readMethodMeta(OPENAPI_META.OPERATION, ctor, propKey);
|
|
468
498
|
const opTags = opMeta?.tags ?? [];
|
|
469
499
|
const tags = [...new Set([...classTags, ...opTags])];
|
|
470
500
|
const params = [];
|
|
471
501
|
const pathParams = this.extractPathParams(route.path);
|
|
472
502
|
for (const name of pathParams) {
|
|
473
|
-
const override = (
|
|
503
|
+
const override = (readMethodMeta(OPENAPI_META.PARAMS, ctor, propKey) ?? []).find((p) => p.name === name);
|
|
474
504
|
params.push({
|
|
475
505
|
name,
|
|
476
506
|
in: "path",
|
|
@@ -480,12 +510,12 @@ class OpenAPIService {
|
|
|
480
510
|
});
|
|
481
511
|
}
|
|
482
512
|
if (route.validation?.query) {
|
|
483
|
-
this.appendZodParams(
|
|
513
|
+
this.appendZodParams("query", route.validation.query, params, false);
|
|
484
514
|
}
|
|
485
515
|
if (route.validation?.headers) {
|
|
486
|
-
this.appendZodParams(
|
|
516
|
+
this.appendZodParams("header", route.validation.headers, params, false);
|
|
487
517
|
}
|
|
488
|
-
const explicitQueries =
|
|
518
|
+
const explicitQueries = readMethodMeta(OPENAPI_META.QUERIES, ctor, propKey) ?? [];
|
|
489
519
|
for (const q of explicitQueries) {
|
|
490
520
|
const idx = params.findIndex((p) => p.in === "query" && p.name === q.name);
|
|
491
521
|
const param = {
|
|
@@ -500,7 +530,7 @@ class OpenAPIService {
|
|
|
500
530
|
else
|
|
501
531
|
params.push(param);
|
|
502
532
|
}
|
|
503
|
-
const explicitParams =
|
|
533
|
+
const explicitParams = readMethodMeta(OPENAPI_META.PARAMS, ctor, propKey) ?? [];
|
|
504
534
|
for (const p of explicitParams) {
|
|
505
535
|
const idx = params.findIndex((x) => x.in === "path" && x.name === p.name);
|
|
506
536
|
const param = {
|
|
@@ -516,7 +546,7 @@ class OpenAPIService {
|
|
|
516
546
|
params.push(param);
|
|
517
547
|
}
|
|
518
548
|
let requestBody;
|
|
519
|
-
const bodyMeta =
|
|
549
|
+
const bodyMeta = readMethodMeta(OPENAPI_META.BODY, ctor, propKey);
|
|
520
550
|
if (bodyMeta?.schema || route.validation?.body) {
|
|
521
551
|
const schema = bodyMeta?.schema ?? route.validation?.body;
|
|
522
552
|
const mediaType = { schema: this.toSchema(schema) };
|
|
@@ -529,7 +559,7 @@ class OpenAPIService {
|
|
|
529
559
|
};
|
|
530
560
|
}
|
|
531
561
|
const responses = {};
|
|
532
|
-
const responseMetas =
|
|
562
|
+
const responseMetas = readMethodMeta(OPENAPI_META.RESPONSES, ctor, propKey) ?? [];
|
|
533
563
|
for (const [status, opt] of responseMetas) {
|
|
534
564
|
const r = { description: opt.description };
|
|
535
565
|
if (opt.schema) {
|
|
@@ -576,7 +606,7 @@ class OpenAPIService {
|
|
|
576
606
|
return {};
|
|
577
607
|
}
|
|
578
608
|
}
|
|
579
|
-
appendZodParams(
|
|
609
|
+
appendZodParams(where, schema, params, required) {
|
|
580
610
|
const json = this.toSchema(schema);
|
|
581
611
|
if (json.type === "object" && json.properties) {
|
|
582
612
|
const req = new Set(json.required ?? []);
|
|
@@ -602,12 +632,12 @@ class OpenAPIService {
|
|
|
602
632
|
return path.replace(/:([A-Za-z0-9_]+)/g, "{$1}");
|
|
603
633
|
}
|
|
604
634
|
}
|
|
635
|
+
__legacyDecorateClassTS([
|
|
636
|
+
Inject("OPENAPI_CONFIG")
|
|
637
|
+
], OpenAPIService.prototype, "_injectConfig", undefined);
|
|
605
638
|
OpenAPIService = __legacyDecorateClassTS([
|
|
606
639
|
Injectable(),
|
|
607
|
-
|
|
608
|
-
__legacyMetadataTS("design:paramtypes", [
|
|
609
|
-
typeof OpenAPIConfig === "undefined" ? Object : OpenAPIConfig
|
|
610
|
-
])
|
|
640
|
+
__legacyMetadataTS("design:paramtypes", [])
|
|
611
641
|
], OpenAPIService);
|
|
612
642
|
function isZodLike(s) {
|
|
613
643
|
if (typeof s !== "object" || s === null)
|
|
@@ -661,83 +691,117 @@ OpenAPIModule = __legacyDecorateClassTS([
|
|
|
661
691
|
})
|
|
662
692
|
], OpenAPIModule);
|
|
663
693
|
// packages/openapi/src/decorators/tags.ts
|
|
664
|
-
import { safeGetMeta as
|
|
694
|
+
import { safeGetMeta as safeGetMeta3, safeDefineMeta } from "@nexusts/core/di/safe-reflect";
|
|
665
695
|
function ApiTags(...tags) {
|
|
666
696
|
return (target) => {
|
|
667
|
-
const existing =
|
|
668
|
-
|
|
697
|
+
const existing = safeGetMeta3(OPENAPI_META.TAGS, target) ?? [];
|
|
698
|
+
safeDefineMeta(OPENAPI_META.TAGS, [...existing, ...tags], target);
|
|
669
699
|
};
|
|
670
700
|
}
|
|
671
701
|
// packages/openapi/src/decorators/operation.ts
|
|
672
|
-
import { safeDefineMeta as
|
|
702
|
+
import { safeDefineMeta as safeDefineMeta2 } from "@nexusts/core/di/safe-reflect";
|
|
673
703
|
function ApiOperation(options) {
|
|
674
|
-
return (
|
|
675
|
-
|
|
704
|
+
return function(targetOrFn, contextOrKey) {
|
|
705
|
+
if (contextOrKey?.kind === "method") {
|
|
706
|
+
const { name, metadata } = contextOrKey;
|
|
707
|
+
metadata[OPENAPI_META.OPERATION] = options;
|
|
708
|
+
storeMethodMetaStandard(targetOrFn, OPENAPI_META.OPERATION, options);
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
const target = targetOrFn;
|
|
712
|
+
const propertyKey = contextOrKey;
|
|
713
|
+
safeDefineMeta2(OPENAPI_META.OPERATION, options, target.constructor, propertyKey);
|
|
676
714
|
};
|
|
677
715
|
}
|
|
678
716
|
// packages/openapi/src/decorators/response.ts
|
|
679
|
-
import { safeGetMeta as safeGetMeta4, safeDefineMeta as
|
|
717
|
+
import { safeGetMeta as safeGetMeta4, safeDefineMeta as safeDefineMeta3 } from "@nexusts/core/di/safe-reflect";
|
|
680
718
|
function ApiResponse(status, options) {
|
|
681
|
-
|
|
719
|
+
const entry = [String(status), options];
|
|
720
|
+
return function(targetOrFn, contextOrKey) {
|
|
721
|
+
if (contextOrKey?.kind === "method") {
|
|
722
|
+
const { name, metadata } = contextOrKey;
|
|
723
|
+
const existing2 = metadata[OPENAPI_META.RESPONSES] ?? [];
|
|
724
|
+
existing2.push(entry);
|
|
725
|
+
metadata[OPENAPI_META.RESPONSES] = existing2;
|
|
726
|
+
storeMethodMetaStandard(targetOrFn, OPENAPI_META.RESPONSES, existing2);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
const target = targetOrFn;
|
|
730
|
+
const propertyKey = contextOrKey;
|
|
682
731
|
const existing = safeGetMeta4(OPENAPI_META.RESPONSES, target.constructor, propertyKey) ?? [];
|
|
683
|
-
existing.push(
|
|
684
|
-
|
|
732
|
+
existing.push(entry);
|
|
733
|
+
safeDefineMeta3(OPENAPI_META.RESPONSES, existing, target.constructor, propertyKey);
|
|
685
734
|
};
|
|
686
735
|
}
|
|
687
736
|
// packages/openapi/src/decorators/param.ts
|
|
688
|
-
import { safeGetMeta as safeGetMeta5, safeDefineMeta as
|
|
689
|
-
function
|
|
690
|
-
return (
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
737
|
+
import { safeGetMeta as safeGetMeta5, safeDefineMeta as safeDefineMeta4 } from "@nexusts/core/di/safe-reflect";
|
|
738
|
+
function makeParamDecorator(metaKey) {
|
|
739
|
+
return (options) => {
|
|
740
|
+
return function(targetOrFn, contextOrKey) {
|
|
741
|
+
if (contextOrKey?.kind === "method") {
|
|
742
|
+
const { name, metadata } = contextOrKey;
|
|
743
|
+
const existing2 = metadata[metaKey] ?? [];
|
|
744
|
+
existing2.push(options);
|
|
745
|
+
metadata[metaKey] = existing2;
|
|
746
|
+
storeMethodMetaStandard(targetOrFn, metaKey, existing2);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
const target = targetOrFn;
|
|
750
|
+
const propertyKey = contextOrKey;
|
|
751
|
+
const existing = safeGetMeta5(metaKey, target.constructor, propertyKey) ?? [];
|
|
752
|
+
existing.push(options);
|
|
753
|
+
safeDefineMeta4(metaKey, existing, target.constructor, propertyKey);
|
|
754
|
+
};
|
|
701
755
|
};
|
|
702
756
|
}
|
|
757
|
+
var ApiParam = makeParamDecorator(OPENAPI_META.PARAMS);
|
|
758
|
+
var ApiQuery = makeParamDecorator(OPENAPI_META.QUERIES);
|
|
703
759
|
// packages/openapi/src/decorators/body.ts
|
|
704
|
-
import { safeDefineMeta as
|
|
760
|
+
import { safeDefineMeta as safeDefineMeta5 } from "@nexusts/core/di/safe-reflect";
|
|
705
761
|
function ApiBody(options) {
|
|
706
|
-
return (
|
|
707
|
-
|
|
762
|
+
return function(targetOrFn, contextOrKey) {
|
|
763
|
+
if (contextOrKey?.kind === "method") {
|
|
764
|
+
const { name, metadata } = contextOrKey;
|
|
765
|
+
metadata[OPENAPI_META.BODY] = options;
|
|
766
|
+
storeMethodMetaStandard(targetOrFn, OPENAPI_META.BODY, options);
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
const target = targetOrFn;
|
|
770
|
+
const propertyKey = contextOrKey;
|
|
771
|
+
safeDefineMeta5(OPENAPI_META.BODY, options, target.constructor, propertyKey);
|
|
708
772
|
};
|
|
709
773
|
}
|
|
710
774
|
// packages/openapi/src/decorators/property.ts
|
|
711
|
-
import { safeGetMeta as
|
|
775
|
+
import { safeGetMeta as safeGetMeta6, safeDefineMeta as safeDefineMeta6 } from "@nexusts/core/di/safe-reflect";
|
|
712
776
|
function ApiProperty(options = {}) {
|
|
713
777
|
return (target, propertyKey) => {
|
|
714
|
-
const existing =
|
|
778
|
+
const existing = safeGetMeta6(OPENAPI_META.PROPERTIES, target.constructor) ?? {};
|
|
715
779
|
existing[propertyKey] = options;
|
|
716
|
-
|
|
780
|
+
safeDefineMeta6(OPENAPI_META.PROPERTIES, existing, target.constructor);
|
|
717
781
|
};
|
|
718
782
|
}
|
|
719
783
|
function ApiSchema(name) {
|
|
720
784
|
return (target) => {
|
|
721
|
-
|
|
785
|
+
safeDefineMeta6("nexus:openapi:schemaName", name, target);
|
|
722
786
|
};
|
|
723
787
|
}
|
|
724
788
|
// packages/openapi/src/decorators/security.ts
|
|
725
|
-
import { safeGetMeta as
|
|
789
|
+
import { safeGetMeta as safeGetMeta7, safeDefineMeta as safeDefineMeta7 } from "@nexusts/core/di/safe-reflect";
|
|
726
790
|
function ApiSecurity(name, scopes = []) {
|
|
727
791
|
return (target, _propertyKey, _descriptor) => {
|
|
728
792
|
const key = OPENAPI_META.SECURITY;
|
|
729
|
-
const existing = typeof _propertyKey === "string" || typeof _propertyKey === "symbol" ?
|
|
793
|
+
const existing = typeof _propertyKey === "string" || typeof _propertyKey === "symbol" ? safeGetMeta7(key, target.constructor, _propertyKey) ?? [] : safeGetMeta7(key, target) ?? [];
|
|
730
794
|
existing.push({ [name]: scopes });
|
|
731
795
|
if (typeof _propertyKey === "string" || typeof _propertyKey === "symbol") {
|
|
732
|
-
|
|
796
|
+
safeDefineMeta7(key, existing, target.constructor, _propertyKey);
|
|
733
797
|
} else {
|
|
734
|
-
|
|
798
|
+
safeDefineMeta7(key, existing, target);
|
|
735
799
|
}
|
|
736
800
|
};
|
|
737
801
|
}
|
|
738
802
|
function ApiExclude() {
|
|
739
803
|
return (target, propertyKey) => {
|
|
740
|
-
|
|
804
|
+
safeDefineMeta7(OPENAPI_META.EXCLUDE, true, target.constructor, propertyKey);
|
|
741
805
|
};
|
|
742
806
|
}
|
|
743
807
|
export {
|
|
@@ -758,5 +822,5 @@ export {
|
|
|
758
822
|
ApiBody
|
|
759
823
|
};
|
|
760
824
|
|
|
761
|
-
//# debugId=
|
|
825
|
+
//# debugId=C7EE9912882E846664756E2164756E21
|
|
762
826
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/scalar.ts", "../src/types.ts", "../src/openapi.service.ts", "../src/zod-to-json-schema.ts", "../src/openapi.module.ts", "../src/decorators/tags.ts", "../src/decorators/operation.ts", "../src/decorators/response.ts", "../src/decorators/param.ts", "../src/decorators/body.ts", "../src/decorators/property.ts", "../src/decorators/security.ts"],
|
|
3
|
+
"sources": ["../src/scalar.ts", "../src/types.ts", "../src/openapi.service.ts", "../src/zod-to-json-schema.ts", "../src/decorators/standard-meta.ts", "../src/openapi.module.ts", "../src/decorators/tags.ts", "../src/decorators/operation.ts", "../src/decorators/response.ts", "../src/decorators/param.ts", "../src/decorators/body.ts", "../src/decorators/property.ts", "../src/decorators/security.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"/**\n * Scalar UI HTML — a single self-contained page that loads Scalar\n * from the jsDelivr CDN.\n *\n * The page mounts Scalar as a custom-element via `<script\n * id=\"api-reference\" data-url=\"...\">` and waits for the CDN script\n * to upgrade it.\n *\n * No assets are bundled with the framework. No build step required.\n */\n\nexport function scalarHtml(opts: { title: string; specUrl: string; theme?: \"default\" | \"dark\" | \"purple\" | \"alternate\" | \"moon\" | \"solarized\" | \"bluePlanet\" | \"saturn\" | \"kepler\" | \"mars\" | \"deepSpace\" | \"laserwave\" | \"none\" }): string {\n\tconst title = escapeHtml(opts.title);\n\tconst theme = opts.theme ?? \"default\";\n\treturn `<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>${title} — API Reference</title>\n <meta name=\"description\" content=\"API reference for ${title}, generated from OpenAPI.\" />\n <style>\n :root { color-scheme: light dark; }\n body { margin: 0; font-family: ui-sans-serif, system-ui, sans-serif; }\n </style>\n</head>\n<body>\n <script\n id=\"api-reference\"\n type=\"application/json\"\n data-url=\"${escapeHtml(opts.specUrl)}\"\n data-configuration='${escapeJsonForAttr(JSON.stringify({ theme, hideClientButton: true }))}'\n ></script>\n <script src=\"https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.0\"></script>\n</body>\n</html>`;\n}\n\nfunction escapeHtml(s: string): string {\n\treturn s\n\t\t.replace(/&/g, \"&\")\n\t\t.replace(/</g, \"<\")\n\t\t.replace(/>/g, \">\")\n\t\t.replace(/\"/g, \""\")\n\t\t.replace(/'/g, \"'\");\n}\n\n/**\n * Encode a string for use inside an HTML attribute value. We avoid\n * `"` so the value remains valid JSON for Scalar's parser.\n */\nfunction escapeJsonForAttr(s: string): string {\n\treturn s.replace(/'/g, \"'\").replace(/</g, \"<\");\n}",
|
|
6
|
-
"/**\
|
|
7
|
-
"/**\n * `OpenAPIService` — walks the framework's route table, reads\n * `@ApiTags` / `@ApiOperation` / `@ApiResponse` / `@ApiBody` /\n * `@ApiParam` / `@ApiQuery` / `@Validate` metadata, and produces an\n * OpenAPI 3.1 document.\n *\n * The document is rebuilt on demand (cheap: in-memory walk) and\n * exposed via `getSpec()`. The framework's router already exposes a\n * `getRoutes()` method that returns the registered route list, so\n * the spec is always in sync with the actual API.\n */\nimport { Inject, Injectable } from \"@nexusts/core\";\nimport type {\n\tApiOperationOptions,\n\tApiParamOptions,\n\tApiPropertyOptions,\n\tApiResponseOptions,\n\tJSONSchema,\n\tOPENAPI_META as _OM,\n\tOpenAPIConfig,\n\tOpenAPIDocument,\n\tOpenAPIMediaType,\n\tOpenAPIOperation,\n\tOpenAPIParameter,\n\tOpenAPIRequestBody,\n\tOpenAPIResponse,\n} from \"./types.js\";\nimport { OPENAPI_META } from \"./types.js\";\nimport { zodToJsonSchema } from \"./zod-to-json-schema.js\";\nimport { safeGetMeta, safeDefineMeta, safeHasMeta } from \"@nexusts/core/di/safe-reflect\";\n\n@Injectable()\nexport class OpenAPIService {\n\t/** DI token. */\n\tstatic readonly TOKEN = Symbol.for(\"nexus:OpenAPIService\");\n\n\t#config: OpenAPIConfig;\n\t#components: { schemas: Map<string, JSONSchema> } = { schemas: new Map() };\n\t#routes: { method: string; path: string; target: any; propertyKey: string | symbol; validation?: any }[] = [];\n\n\tconstructor(@Inject(\"OPENAPI_CONFIG\") config: OpenAPIConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * Inject the route list. The framework's router calls this on boot.\n\t * Each entry is the data needed to emit one OpenAPI operation.\n\t */\n\tsetRoutes(\n\t\troutes: {\n\t\t\tmethod: string;\n\t\t\tpath: string;\n\t\t\ttarget: any;\n\t\t\tpropertyKey: string | symbol;\n\t\t\tvalidation?: { body?: unknown; query?: unknown; params?: unknown; headers?: unknown };\n\t\t}[],\n\t): void {\n\t\tthis.#routes = routes;\n\t}\n\n\t/** Register a named component schema (e.g. for re-use). */\n\tregisterSchema(name: string, schema: JSONSchema): void {\n\t\tthis.#components.schemas.set(name, schema);\n\t}\n\n\t/** Build the OpenAPI 3.1 document. */\n\tgetSpec(): OpenAPIDocument {\n\t\tconst paths: Record<string, Record<string, OpenAPIOperation>> = {};\n\t\tfor (const route of this.#routes) {\n\t\t\tif (safeGetMeta(OPENAPI_META.EXCLUDE, route.target.constructor, route.propertyKey)) continue;\n\t\t\tconst op = this.buildOperation(route);\n\t\t\tconst normalized = this.normalizePath(route.path);\n\t\t\tconst method = route.method.toLowerCase();\n\t\t\tif (!paths[normalized]) paths[normalized] = {};\n\t\t\tpaths[normalized][method] = op;\n\t\t}\n\n\t\tconst doc: OpenAPIDocument = {\n\t\t\topenapi: \"3.1.0\",\n\t\t\tinfo: this.#config.info,\n\t\t\tpaths,\n\t\t};\n\t\tif (this.#config.servers?.length) doc.servers = this.#config.servers;\n\t\tif (this.#config.tags?.length) doc.tags = this.#config.tags;\n\t\tif (this.#config.externalDocs) doc.externalDocs = this.#config.externalDocs;\n\t\tif (this.#components.schemas.size > 0) {\n\t\t\tdoc.components = {\n\t\t\t\tschemas: Object.fromEntries(this.#components.schemas),\n\t\t\t};\n\t\t}\n\t\treturn doc;\n\t}\n\n\t/**\n\t * Build one operation from a route.\n\t */\n\tprivate buildOperation(route: {\n\t\tmethod: string;\n\t\tpath: string;\n\t\ttarget: any;\n\t\tpropertyKey: string | symbol;\n\t\tvalidation?: { body?: unknown; query?: unknown; params?: unknown; headers?: unknown };\n\t}): OpenAPIOperation {\n\t\tconst ctor = route.target.constructor ?? route.target;\n\t\tconst propKey = route.propertyKey;\n\n\t\t// 1. Tags from class + operation\n\t\tconst classTags: string[] = safeGetMeta(OPENAPI_META.TAGS, ctor) ?? [];\n\t\tconst opMeta: ApiOperationOptions | undefined = safeGetMeta(\n\t\t\tOPENAPI_META.OPERATION,\n\t\t\tctor,\n\t\t\tpropKey,\n\t\t);\n\t\tconst opTags: string[] = opMeta?.tags ?? [];\n\t\tconst tags = [...new Set([...classTags, ...opTags])];\n\n\t\t// 2. Parameters (path / query / headers)\n\t\tconst params: OpenAPIParameter[] = [];\n\t\t// Auto-derive path params from the route pattern.\n\t\tconst pathParams = this.extractPathParams(route.path);\n\t\tfor (const name of pathParams) {\n\t\t\tconst override = (\n\t\t\t\t(safeGetMeta(OPENAPI_META.PARAMS, ctor, propKey) ?? []) as ApiParamOptions[]\n\t\t\t).find((p) => p.name === name);\n\t\t\tparams.push({\n\t\t\t\tname,\n\t\t\t\tin: \"path\",\n\t\t\t\trequired: true,\n\t\t\t\tdescription: override?.description,\n\t\t\t\tschema: override?.schema ? this.toSchema(override.schema) : { type: \"string\" },\n\t\t\t});\n\t\t}\n\t\t// Auto-derive query params from `@Validate({ query })`.\n\t\tif (route.validation?.query) {\n\t\t\tthis.appendZodParams(\n\t\t\t\tctor,\n\t\t\t\tpropKey,\n\t\t\t\t\"query\",\n\t\t\t\troute.validation.query,\n\t\t\t\tparams,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t\t// Auto-derive headers from `@Validate({ headers })`.\n\t\tif (route.validation?.headers) {\n\t\t\tthis.appendZodParams(\n\t\t\t\tctor,\n\t\t\t\tpropKey,\n\t\t\t\t\"header\",\n\t\t\t\troute.validation.headers,\n\t\t\t\tparams,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t\t// Explicit `@ApiQuery` decorators override / supplement.\n\t\tconst explicitQueries: ApiParamOptions[] =\n\t\t\tsafeGetMeta(OPENAPI_META.QUERIES, ctor, propKey) ?? [];\n\t\tfor (const q of explicitQueries) {\n\t\t\t// Replace any auto-derived entry for the same name.\n\t\t\tconst idx = params.findIndex(\n\t\t\t\t(p) => p.in === \"query\" && p.name === q.name,\n\t\t\t);\n\t\t\tconst param: OpenAPIParameter = {\n\t\t\t\tname: q.name,\n\t\t\t\tin: \"query\",\n\t\t\t\trequired: q.required ?? false,\n\t\t\t\tdescription: q.description,\n\t\t\t\tschema: q.schema ? this.toSchema(q.schema) : { type: \"string\" },\n\t\t\t};\n\t\t\tif (idx >= 0) params[idx] = param;\n\t\t\telse params.push(param);\n\t\t}\n\t\t// Explicit `@ApiParam` decorators override path params.\n\t\tconst explicitParams: ApiParamOptions[] =\n\t\t\tsafeGetMeta(OPENAPI_META.PARAMS, ctor, propKey) ?? [];\n\t\tfor (const p of explicitParams) {\n\t\t\tconst idx = params.findIndex(\n\t\t\t\t(x) => x.in === \"path\" && x.name === p.name,\n\t\t\t);\n\t\t\tconst param: OpenAPIParameter = {\n\t\t\t\tname: p.name,\n\t\t\t\tin: \"path\",\n\t\t\t\trequired: p.required ?? true,\n\t\t\t\tdescription: p.description,\n\t\t\t\tschema: p.schema ? this.toSchema(p.schema) : { type: \"string\" },\n\t\t\t};\n\t\t\tif (idx >= 0) params[idx] = param;\n\t\t\telse params.push(param);\n\t\t}\n\n\t\t// 3. Request body\n\t\tlet requestBody: OpenAPIRequestBody | undefined;\n\t\tconst bodyMeta = safeGetMeta(OPENAPI_META.BODY, ctor, propKey);\n\t\tif (bodyMeta?.schema || route.validation?.body) {\n\t\t\tconst schema = bodyMeta?.schema ?? route.validation?.body;\n\t\t\tconst mediaType: OpenAPIMediaType = { schema: this.toSchema(schema) };\n\t\t\tif (bodyMeta?.example !== undefined) mediaType.example = bodyMeta.example;\n\t\t\trequestBody = {\n\t\t\t\tdescription: bodyMeta?.description ?? \"Request body\",\n\t\t\t\tcontent: { \"application/json\": mediaType },\n\t\t\t\trequired: bodyMeta?.required ?? true,\n\t\t\t};\n\t\t}\n\n\t\t// 4. Responses\n\t\tconst responses: Record<string, OpenAPIResponse> = {};\n\t\tconst responseMetas: Array<[string, ApiResponseOptions]> =\n\t\t\tsafeGetMeta(OPENAPI_META.RESPONSES, ctor, propKey) ?? [];\n\t\tfor (const [status, opt] of responseMetas) {\n\t\t\tconst r: OpenAPIResponse = { description: opt.description };\n\t\t\tif (opt.schema) {\n\t\t\t\tr.content = {\n\t\t\t\t\t\"application/json\": {\n\t\t\t\t\t\tschema: this.toSchema(opt.schema),\n\t\t\t\t\t\t...(opt.example !== undefined ? { example: opt.example } : {}),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tresponses[status] = r;\n\t\t}\n\t\t// Default 200 OK if no responses declared.\n\t\tif (Object.keys(responses).length === 0) {\n\t\t\tresponses[\"200\"] = { description: \"Successful response\" };\n\t\t}\n\n\t\t// 5. Compose\n\t\tconst op: OpenAPIOperation = {\n\t\t\tresponses,\n\t\t};\n\t\tif (tags.length > 0) op.tags = tags;\n\t\tif (opMeta?.summary) op.summary = opMeta.summary;\n\t\tif (opMeta?.description) op.description = opMeta.description;\n\t\tif (opMeta?.operationId) op.operationId = opMeta.operationId;\n\t\tif (opMeta?.deprecated) op.deprecated = true;\n\t\tif (params.length > 0) op.parameters = params;\n\t\tif (requestBody) op.requestBody = requestBody;\n\t\treturn op;\n\t}\n\n\t/**\n\t * Convert any of:\n\t * - a Zod schema → JSON Schema via `zodToJsonSchema`\n\t * - a `JSONSchema` object → passthrough\n\t * - a class decorated with `@ApiProperty` → JSON Schema\n\t * - `null` / `undefined` → empty object\n\t */\n\tprivate toSchema(input: unknown): JSONSchema {\n\t\tif (input == null) return {};\n\t\t// JSONSchema passthrough (has `type` or `$ref` or any of our keys).\n\t\tif (typeof input === \"object\" && !isZodLike(input)) {\n\t\t\treturn input as JSONSchema;\n\t\t}\n\t\t// Zod-like: try the converter.\n\t\ttry {\n\t\t\treturn zodToJsonSchema(input);\n\t\t} catch {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tprivate appendZodParams(\n\t\tctor: any,\n\t\tpropKey: string | symbol,\n\t\twhere: \"query\" | \"header\",\n\t\tschema: unknown,\n\t\tparams: OpenAPIParameter[],\n\t\trequired: boolean,\n\t): void {\n\t\tconst json = this.toSchema(schema);\n\t\t// Unwrap top-level object to one entry per property.\n\t\tif (json.type === \"object\" && json.properties) {\n\t\t\tconst req = new Set(json.required ?? []);\n\t\t\tfor (const [name, sub] of Object.entries(json.properties)) {\n\t\t\t\tparams.push({\n\t\t\t\t\tname,\n\t\t\t\t\tin: where,\n\t\t\t\t\trequired: required || req.has(name),\n\t\t\t\t\tschema: sub,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate extractPathParams(path: string): string[] {\n\t\tconst out: string[] = [];\n\t\tconst re = /:([A-Za-z0-9_]+)/g;\n\t\tlet m: RegExpExecArray | null;\n\t\twhile ((m = re.exec(path)) !== null) out.push(m[1]!);\n\t\treturn out;\n\t}\n\n\tprivate normalizePath(path: string): string {\n\t\treturn path.replace(/:([A-Za-z0-9_]+)/g, \"{$1}\");\n\t}\n}\n\nfunction isZodLike(s: unknown): boolean {\n\tif (typeof s !== \"object\" || s === null) return false;\n\tconst o = s as { _def?: { typeName?: string }; typeName?: string };\n\tconst t = o._def?.typeName ?? o.typeName;\n\treturn typeof t === \"string\" && t.startsWith(\"Zod\");\n}",
|
|
6
|
+
"/**\n * `@nexusts/openapi` — OpenAPI 3.1 + Scalar UI.\n *\n * @Module({\n * imports: [\n * OpenAPIModule.forRoot({\n * info: { title: 'My API', version: '1.0.0' },\n * servers: [{ url: 'http://localhost:3000' }],\n * }),\n * ],\n * })\n *\n * @Controller('/users')\n * @ApiTags('Users')\n * class UserController {\n * @Get('/')\n * @ApiOperation({ summary: 'List users' })\n * @ApiResponse(200, { description: 'OK', schema: UserSchema })\n * list() { ... }\n * }\n *\n * // -> GET /openapi.json (the spec)\n * // -> GET /docs (Scalar UI)\n */\n\n\n// ---------------------------------------------------------------------------\n// OpenAPI spec types (subset of OpenAPI 3.1 — enough for 95% of real APIs)\n// ---------------------------------------------------------------------------\n\nexport interface OpenAPIConfig {\n\t/** Top-level info block. */\n\tinfo: OpenAPIInfo;\n\t/** Server URLs. Default: [{ url: '/' }]. */\n\tservers?: OpenAPIServer[];\n\t/** Tags grouped at the top of the spec. */\n\ttags?: OpenAPITag[];\n\t/** Path under which the JSON spec is served. Default: '/openapi.json'. */\n\tspecPath?: string;\n\t/** Path under which the Scalar UI is served. Default: '/docs'. */\n\tpath?: string;\n\t/** External docs link. */\n\texternalDocs?: { url: string; description?: string };\n}\n\nexport interface OpenAPIInfo {\n\ttitle: string;\n\tversion: string;\n\tdescription?: string;\n\ttermsOfService?: string;\n\tcontact?: { name?: string; url?: string; email?: string };\n\tlicense?: { name: string; url?: string };\n}\n\nexport interface OpenAPIServer {\n\turl: string;\n\tdescription?: string;\n\tvariables?: Record<string, { default: string; enum?: string[]; description?: string }>;\n}\n\nexport interface OpenAPITag {\n\tname: string;\n\tdescription?: string;\n\texternalDocs?: { url: string; description?: string };\n}\n\n/** OpenAPI Path Item. */\nexport interface OpenAPIPath {\n\t[method: string]: OpenAPIOperation | undefined;\n}\n\n/** OpenAPI Operation. */\nexport interface OpenAPIOperation {\n\ttags?: string[];\n\tsummary?: string;\n\tdescription?: string;\n\toperationId?: string;\n\tparameters?: OpenAPIParameter[];\n\trequestBody?: OpenAPIRequestBody;\n\tresponses: Record<string, OpenAPIResponse>;\n\tdeprecated?: boolean;\n\tsecurity?: OpenAPISecurity[];\n}\n\n/** OpenAPI Parameter (path, query, header, cookie). */\nexport interface OpenAPIParameter {\n\tname: string;\n\tin: \"path\" | \"query\" | \"header\" | \"cookie\";\n\tdescription?: string;\n\trequired?: boolean;\n\tdeprecated?: boolean;\n\tschema: JSONSchema;\n\texample?: unknown;\n\texamples?: Record<string, { summary?: string; value: unknown }>;\n}\n\n/** OpenAPI Request Body. */\nexport interface OpenAPIRequestBody {\n\tdescription?: string;\n\tcontent: Record<string, OpenAPIMediaType>;\n\trequired?: boolean;\n}\n\nexport interface OpenAPIMediaType {\n\tschema: JSONSchema;\n\texample?: unknown;\n\texamples?: Record<string, { summary?: string; value: unknown }>;\n\tencoding?: Record<string, OpenAPIEncoding>;\n}\n\nexport interface OpenAPIEncoding {\n\tcontentType?: string;\n\theaders?: Record<string, OpenAPIParameter>;\n\tstyle?: string;\n\texplode?: boolean;\n\tallowReserved?: boolean;\n}\n\n/** OpenAPI Response. */\nexport interface OpenAPIResponse {\n\tdescription: string;\n\theaders?: Record<string, OpenAPIParameter>;\n\tcontent?: Record<string, OpenAPIMediaType>;\n\tlinks?: Record<string, OpenAPILink>;\n}\n\nexport interface OpenAPILink {\n\toperationRef?: string;\n\toperationId?: string;\n\tparameters?: Record<string, unknown>;\n\tdescription?: string;\n\tserver?: OpenAPIServer;\n}\n\nexport interface OpenAPISecurity {\n\t[name: string]: string[];\n}\n\n/** OpenAPI Component (schemas, parameters, responses, ...). */\nexport interface OpenAPIComponents {\n\tschemas?: Record<string, JSONSchema>;\n\tparameters?: Record<string, OpenAPIParameter>;\n\tresponses?: Record<string, OpenAPIResponse>;\n\trequestBodies?: Record<string, OpenAPIRequestBody>;\n\theaders?: Record<string, OpenAPIParameter>;\n\tsecuritySchemes?: Record<string, OpenAPISecurityScheme>;\n\tlinks?: Record<string, OpenAPILink>;\n}\n\nexport interface OpenAPISecurityScheme {\n\ttype: \"apiKey\" | \"http\" | \"oauth2\" | \"openIdConnect\" | \"mutualTLS\";\n\tdescription?: string;\n\tname?: string;\n\tin?: \"query\" | \"header\" | \"cookie\";\n\tscheme?: string;\n\tbearerFormat?: string;\n\tflows?: unknown;\n\topenIdConnectUrl?: string;\n}\n\nexport interface OpenAPIDocument {\n\topenapi: \"3.1.0\";\n\tinfo: OpenAPIInfo;\n\tservers?: OpenAPIServer[];\n\tpaths: Record<string, OpenAPIPath>;\n\tcomponents?: OpenAPIComponents;\n\ttags?: OpenAPITag[];\n\texternalDocs?: { url: string; description?: string };\n\tsecurity?: OpenAPISecurity[];\n\twebhooks?: Record<string, OpenAPIPath | OpenAPIOperation>;\n}\n\n// ---------------------------------------------------------------------------\n// JSON Schema (subset)\n// ---------------------------------------------------------------------------\n\nexport interface JSONSchema {\n\t$ref?: string;\n\ttype?:\n\t\t| \"string\"\n\t\t| \"number\"\n\t\t| \"integer\"\n\t\t| \"boolean\"\n\t\t| \"object\"\n\t\t| \"array\"\n\t\t| \"null\"\n\t\t| (string & {});\n\tformat?: string;\n\ttitle?: string;\n\tdescription?: string;\n\tdefault?: unknown;\n\texample?: unknown;\n\tenum?: unknown[];\n\tconst?: unknown;\n\tproperties?: Record<string, JSONSchema>;\n\trequired?: string[];\n\tadditionalProperties?: boolean | JSONSchema;\n\titems?: JSONSchema;\n\tprefixItems?: JSONSchema[];\n\tminItems?: number;\n\tmaxItems?: number;\n\tuniqueItems?: boolean;\n\tminimum?: number;\n\tmaximum?: number;\n\tminLength?: number;\n\tmaxLength?: number;\n\tpattern?: string;\n\tnullable?: boolean;\n\toneOf?: JSONSchema[];\n\tanyOf?: JSONSchema[];\n\tallOf?: JSONSchema[];\n\tnot?: JSONSchema;\n\t$defs?: Record<string, JSONSchema>;\n\t$schema?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Decorator payload types\n// ---------------------------------------------------------------------------\n\nexport interface ApiOperationOptions {\n\tsummary?: string;\n\tdescription?: string;\n\toperationId?: string;\n\tdeprecated?: boolean;\n\ttags?: string[];\n}\n\nexport interface ApiResponseOptions {\n\tdescription: string;\n\tschema?: unknown;\n\theaders?: Record<string, OpenAPIParameter>;\n\texample?: unknown;\n\texamples?: Record<string, { summary?: string; value: unknown }>;\n}\n\nexport interface ApiParamOptions {\n\tname: string;\n\tdescription?: string;\n\trequired?: boolean;\n\tschema?: unknown;\n\texample?: unknown;\n}\n\nexport interface ApiQueryOptions extends Omit<ApiParamOptions, \"name\"> {\n\tname: string;\n}\n\nexport interface ApiBodyOptions {\n\tdescription?: string;\n\trequired?: boolean;\n\tschema?: unknown;\n\texample?: unknown;\n}\n\nexport interface ApiPropertyOptions {\n\tdescription?: string;\n\trequired?: boolean;\n\texample?: unknown;\n\tdeprecated?: boolean;\n\tformat?: string;\n\tschema?: unknown;\n}\n\nexport interface ApiSecurityOptions {\n\t[name: string]: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Reflect metadata keys\n// ---------------------------------------------------------------------------\n\nexport const OPENAPI_META = {\n\tTAGS: \"nexus:openapi:tags\",\n\tOPERATION: \"nexus:openapi:operation\",\n\tRESPONSES: \"nexus:openapi:responses\",\n\tPARAMS: \"nexus:openapi:params\",\n\tQUERIES: \"nexus:openapi:queries\",\n\tBODY: \"nexus:openapi:body\",\n\tPROPERTIES: \"nexus:openapi:properties\",\n\tSECURITY: \"nexus:openapi:security\",\n\tEXCLUDE: \"nexus:openapi:exclude\",\n\tPRODUCES: \"nexus:openapi:produces\",\n\tCONSUMES: \"nexus:openapi:consumes\",\n} as const;\n",
|
|
7
|
+
"/**\n * `OpenAPIService` — walks the framework's route table, reads\n * `@ApiTags` / `@ApiOperation` / `@ApiResponse` / `@ApiBody` /\n * `@ApiParam` / `@ApiQuery` / `@Validate` metadata, and produces an\n * OpenAPI 3.1 document.\n *\n * The document is rebuilt on demand (cheap: in-memory walk) and\n * exposed via `getSpec()`. The framework's router already exposes a\n * `getRoutes()` method that returns the registered route list, so\n * the spec is always in sync with the actual API.\n */\nimport { Inject, Injectable } from \"@nexusts/core\";\nimport type {\n\tApiOperationOptions,\n\tApiParamOptions,\n\tApiResponseOptions,\n\tJSONSchema,\n\tOPENAPI_META as _OM,\n\tOpenAPIConfig,\n\tOpenAPIDocument,\n\tOpenAPIMediaType,\n\tOpenAPIOperation,\n\tOpenAPIParameter,\n\tOpenAPIRequestBody,\n\tOpenAPIResponse,\n} from \"./types.js\";\nimport { OPENAPI_META } from \"./types.js\";\nimport { zodToJsonSchema } from \"./zod-to-json-schema.js\";\nimport { safeGetMeta } from \"@nexusts/core/di/safe-reflect\";\nimport {\n\treadMethodMeta,\n\t\n} from \"./decorators/standard-meta.js\";\n\n@Injectable()\nexport class OpenAPIService {\n\t/** DI token. */\n\tstatic readonly TOKEN = Symbol.for(\"nexus:OpenAPIService\");\n\n\t#config!: OpenAPIConfig;\n\t#components: { schemas: Map<string, JSONSchema> } = { schemas: new Map() };\n\t#routes: { method: string; path: string; target: any; propertyKey: string | symbol; validation?: any }[] = [];\n\n\t/** OpenAPI config — injected by DI container. */\n\t@Inject(\"OPENAPI_CONFIG\") declare private _injectConfig: OpenAPIConfig;\n\n\tconstructor() {\n\t\t// DI sets @Inject fields before first use.\n\t\t// When called directly (without DI), provide a fallback.\n\t\tif (!this.#config) {\n\t\t\tthis.#config = this._injectConfig ?? { info: { title: \"API\", version: \"0.0.0\" } };\n\t\t}\n\t}\n\n\t/**\n\t * Inject the route list. The framework's router calls this on boot.\n\t * Each entry is the data needed to emit one OpenAPI operation.\n\t */\n\tsetRoutes(\n\t\troutes: {\n\t\t\tmethod: string;\n\t\t\tpath: string;\n\t\t\ttarget: any;\n\t\t\tpropertyKey: string | symbol;\n\t\t\tvalidation?: { body?: unknown; query?: unknown; params?: unknown; headers?: unknown };\n\t\t}[],\n\t): void {\n\t\tthis.#routes = routes;\n\t}\n\n\t/** Register a named component schema (e.g. for re-use). */\n\tregisterSchema(name: string, schema: JSONSchema): void {\n\t\tthis.#components.schemas.set(name, schema);\n\t}\n\n\t/** Build the OpenAPI 3.1 document. */\n\tgetSpec(): OpenAPIDocument {\n\t\tconst paths: Record<string, Record<string, OpenAPIOperation>> = {};\n\t\tfor (const route of this.#routes) {\n\t\t\tif (safeGetMeta(OPENAPI_META.EXCLUDE, route.target.constructor, route.propertyKey)) continue;\n\t\t\tconst op = this.buildOperation(route);\n\t\t\tconst normalized = this.normalizePath(route.path);\n\t\t\tconst method = route.method.toLowerCase();\n\t\t\tif (!paths[normalized]) paths[normalized] = {};\n\t\t\tpaths[normalized][method] = op;\n\t\t}\n\n\t\tconst doc: OpenAPIDocument = {\n\t\t\topenapi: \"3.1.0\",\n\t\t\tinfo: this.#config.info,\n\t\t\tpaths,\n\t\t};\n\t\tif (this.#config.servers?.length) doc.servers = this.#config.servers;\n\t\tif (this.#config.tags?.length) doc.tags = this.#config.tags;\n\t\tif (this.#config.externalDocs) doc.externalDocs = this.#config.externalDocs;\n\t\tif (this.#components.schemas.size > 0) {\n\t\t\tdoc.components = {\n\t\t\t\tschemas: Object.fromEntries(this.#components.schemas),\n\t\t\t};\n\t\t}\n\t\treturn doc;\n\t}\n\n\t/**\n\t * Build one operation from a route.\n\t */\n\tprivate buildOperation(route: {\n\t\tmethod: string;\n\t\tpath: string;\n\t\ttarget: any;\n\t\tpropertyKey: string | symbol;\n\t\tvalidation?: { body?: unknown; query?: unknown; params?: unknown; headers?: unknown };\n\t}): OpenAPIOperation {\n\t\tconst ctor = route.target.constructor ?? route.target;\n\t\tconst propKey = route.propertyKey;\n\n\t\t// 1. Tags from class + operation\n\t\tconst classTags: string[] = safeGetMeta(OPENAPI_META.TAGS, ctor) ?? [];\n\t\tconst opMeta: ApiOperationOptions | undefined = readMethodMeta<ApiOperationOptions>(\n\t\t\tOPENAPI_META.OPERATION,\n\t\t\tctor,\n\t\t\tpropKey,\n\t\t);\n\t\tconst opTags: string[] = opMeta?.tags ?? [];\n\t\tconst tags = [...new Set([...classTags, ...opTags])];\n\n\t\t// 2. Parameters (path / query / headers)\n\t\tconst params: OpenAPIParameter[] = [];\n\t\t// Auto-derive path params from the route pattern.\n\t\tconst pathParams = this.extractPathParams(route.path);\n\t\tfor (const name of pathParams) {\n\t\t\tconst override = (\n\t\t\t\t(readMethodMeta(OPENAPI_META.PARAMS, ctor, propKey) ?? []) as ApiParamOptions[]\n\t\t\t).find((p) => p.name === name);\n\t\t\tparams.push({\n\t\t\t\tname,\n\t\t\t\tin: \"path\",\n\t\t\t\trequired: true,\n\t\t\t\tdescription: override?.description,\n\t\t\t\tschema: override?.schema ? this.toSchema(override.schema) : { type: \"string\" },\n\t\t\t});\n\t\t}\n\t\t// Auto-derive query params from `@Validate({ query })`.\n\t\tif (route.validation?.query) {\n\t\t\tthis.appendZodParams(\n\t\t\t\t\"query\",\n\t\t\t\troute.validation.query,\n\t\t\t\tparams,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t\t// Auto-derive headers from `@Validate({ headers })`.\n\t\tif (route.validation?.headers) {\n\t\t\tthis.appendZodParams(\n\t\t\t\t\"header\",\n\t\t\t\troute.validation.headers,\n\t\t\t\tparams,\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t\t// Explicit `@ApiQuery` decorators override / supplement.\n\t\tconst explicitQueries: ApiParamOptions[] =\n\t\t\treadMethodMeta(OPENAPI_META.QUERIES, ctor, propKey) ?? [];\n\t\tfor (const q of explicitQueries) {\n\t\t\t// Replace any auto-derived entry for the same name.\n\t\t\tconst idx = params.findIndex(\n\t\t\t\t(p) => p.in === \"query\" && p.name === q.name,\n\t\t\t);\n\t\t\tconst param: OpenAPIParameter = {\n\t\t\t\tname: q.name,\n\t\t\t\tin: \"query\",\n\t\t\t\trequired: q.required ?? false,\n\t\t\t\tdescription: q.description,\n\t\t\t\tschema: q.schema ? this.toSchema(q.schema) : { type: \"string\" },\n\t\t\t};\n\t\t\tif (idx >= 0) params[idx] = param;\n\t\t\telse params.push(param);\n\t\t}\n\t\t// Explicit `@ApiParam` decorators override path params.\n\t\tconst explicitParams: ApiParamOptions[] =\n\t\t\treadMethodMeta(OPENAPI_META.PARAMS, ctor, propKey) ?? [];\n\t\tfor (const p of explicitParams) {\n\t\t\tconst idx = params.findIndex(\n\t\t\t\t(x) => x.in === \"path\" && x.name === p.name,\n\t\t\t);\n\t\t\tconst param: OpenAPIParameter = {\n\t\t\t\tname: p.name,\n\t\t\t\tin: \"path\",\n\t\t\t\trequired: p.required ?? true,\n\t\t\t\tdescription: p.description,\n\t\t\t\tschema: p.schema ? this.toSchema(p.schema) : { type: \"string\" },\n\t\t\t};\n\t\t\tif (idx >= 0) params[idx] = param;\n\t\t\telse params.push(param);\n\t\t}\n\n\t\t// 3. Request body\n\t\tlet requestBody: OpenAPIRequestBody | undefined;\n\t\tconst bodyMeta = readMethodMeta<{schema?: unknown; example?: unknown; description?: string; required?: boolean}>(OPENAPI_META.BODY, ctor, propKey);\n\t\tif (bodyMeta?.schema || route.validation?.body) {\n\t\t\tconst schema = bodyMeta?.schema ?? route.validation?.body;\n\t\t\tconst mediaType: OpenAPIMediaType = { schema: this.toSchema(schema) };\n\t\t\tif (bodyMeta?.example !== undefined) mediaType.example = bodyMeta.example;\n\t\t\trequestBody = {\n\t\t\t\tdescription: bodyMeta?.description ?? \"Request body\",\n\t\t\t\tcontent: { \"application/json\": mediaType },\n\t\t\t\trequired: bodyMeta?.required ?? true,\n\t\t\t};\n\t\t}\n\n\t\t// 4. Responses\n\t\tconst responses: Record<string, OpenAPIResponse> = {};\n\t\tconst responseMetas: Array<[string, ApiResponseOptions]> =\n\t\t\treadMethodMeta(OPENAPI_META.RESPONSES, ctor, propKey) ?? [];\n\t\tfor (const [status, opt] of responseMetas) {\n\t\t\tconst r: OpenAPIResponse = { description: opt.description };\n\t\t\tif (opt.schema) {\n\t\t\t\tr.content = {\n\t\t\t\t\t\"application/json\": {\n\t\t\t\t\t\tschema: this.toSchema(opt.schema),\n\t\t\t\t\t\t...(opt.example !== undefined ? { example: opt.example } : {}),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t\tresponses[status] = r;\n\t\t}\n\t\t// Default 200 OK if no responses declared.\n\t\tif (Object.keys(responses).length === 0) {\n\t\t\tresponses[\"200\"] = { description: \"Successful response\" };\n\t\t}\n\n\t\t// 5. Compose\n\t\tconst op: OpenAPIOperation = {\n\t\t\tresponses,\n\t\t};\n\t\tif (tags.length > 0) op.tags = tags;\n\t\tif (opMeta?.summary) op.summary = opMeta.summary;\n\t\tif (opMeta?.description) op.description = opMeta.description;\n\t\tif (opMeta?.operationId) op.operationId = opMeta.operationId;\n\t\tif (opMeta?.deprecated) op.deprecated = true;\n\t\tif (params.length > 0) op.parameters = params;\n\t\tif (requestBody) op.requestBody = requestBody;\n\t\treturn op;\n\t}\n\n\t/**\n\t * Convert any of:\n\t * - a Zod schema → JSON Schema via `zodToJsonSchema`\n\t * - a `JSONSchema` object → passthrough\n\t * - a class decorated with `@ApiProperty` → JSON Schema\n\t * - `null` / `undefined` → empty object\n\t */\n\tprivate toSchema(input: unknown): JSONSchema {\n\t\tif (input == null) return {};\n\t\t// JSONSchema passthrough (has `type` or `$ref` or any of our keys).\n\t\tif (typeof input === \"object\" && !isZodLike(input)) {\n\t\t\treturn input as JSONSchema;\n\t\t}\n\t\t// Zod-like: try the converter.\n\t\ttry {\n\t\t\treturn zodToJsonSchema(input);\n\t\t} catch {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tprivate appendZodParams(\n\t\twhere: \"query\" | \"header\",\n\t\tschema: unknown,\n\t\tparams: OpenAPIParameter[],\n\t\trequired: boolean,\n\t): void {\n\t\tconst json = this.toSchema(schema);\n\t\t// Unwrap top-level object to one entry per property.\n\t\tif (json.type === \"object\" && json.properties) {\n\t\t\tconst req = new Set(json.required ?? []);\n\t\t\tfor (const [name, sub] of Object.entries(json.properties)) {\n\t\t\t\tparams.push({\n\t\t\t\t\tname,\n\t\t\t\t\tin: where,\n\t\t\t\t\trequired: required || req.has(name),\n\t\t\t\t\tschema: sub,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate extractPathParams(path: string): string[] {\n\t\tconst out: string[] = [];\n\t\tconst re = /:([A-Za-z0-9_]+)/g;\n\t\tlet m: RegExpExecArray | null;\n\t\twhile ((m = re.exec(path)) !== null) out.push(m[1]!);\n\t\treturn out;\n\t}\n\n\tprivate normalizePath(path: string): string {\n\t\treturn path.replace(/:([A-Za-z0-9_]+)/g, \"{$1}\");\n\t}\n}\n\nfunction isZodLike(s: unknown): boolean {\n\tif (typeof s !== \"object\" || s === null) return false;\n\tconst o = s as { _def?: { typeName?: string }; typeName?: string };\n\tconst t = o._def?.typeName ?? o.typeName;\n\treturn typeof t === \"string\" && t.startsWith(\"Zod\");\n}",
|
|
8
8
|
"/**\n * `zodToJsonSchema` — convert a Zod schema to an OpenAPI-compatible\n * JSON Schema. Zero dependencies, supports the Zod patterns that\n * show up in real APIs:\n *\n * - primitives (string / number / integer / boolean / null)\n * - literal, enum, nativeEnum\n * - object (with required / optional / nullable fields)\n * - array / tuple\n * - union / discriminatedUnion\n * - optional / nullable / default\n * - record / map\n * - format inference (email, uuid, url, datetime, ...)\n * - min / max / length / regex constraints\n *\n * Limitations (by design):\n * - transforms / pipes / preprocess: not represented\n * - branded types: erased\n * - recursive schemas: pass `$ref` manually via `setRefName`\n *\n * For richer support, pre-compute a `JSONSchema` and pass it via\n * the decorator's `schema` field; this converter is a convenience,\n * not a complete codegen.\n */\n\nimport type { JSONSchema } from \"./types.js\";\n\n/**\n * Convert a Zod schema (or any value that quacks like one) to a\n * JSON Schema object.\n */\nexport function zodToJsonSchema(\n\tschema: unknown,\n\topts: { $defs?: Record<string, JSONSchema>; visited?: WeakSet<object> } = {},\n): JSONSchema {\n\tconst defs = opts.$defs ?? {};\n\tconst visited = opts.visited ?? new WeakSet<object>();\n\tif (visited.has(schema as object)) {\n\t\t// Recursive schema — fall back to `{}` so we don't infinite-loop.\n\t\treturn {};\n\t}\n\tif (typeof schema === \"object\" && schema !== null) {\n\t\tvisited.add(schema as object);\n\t}\n\n\tconst def = readDef(schema);\n\n\t// Primitives\n\tif (def.typeName === \"ZodString\") return convertString(def);\n\tif (def.typeName === \"ZodNumber\") return convertNumber(def);\n\tif (def.typeName === \"ZodBigInt\") return { type: \"integer\", format: \"int64\" };\n\tif (def.typeName === \"ZodBoolean\") return { type: \"boolean\" };\n\tif (def.typeName === \"ZodDate\") return { type: \"string\", format: \"date-time\" };\n\tif (def.typeName === \"ZodNull\") return { type: \"null\" };\n\tif (def.typeName === \"ZodUndefined\") return { not: {} };\n\tif (def.typeName === \"ZodAny\") return {};\n\tif (def.typeName === \"ZodUnknown\") return {};\n\tif (def.typeName === \"ZodNever\") return { not: {} };\n\n\tif (def.typeName === \"ZodLiteral\") {\n\t\tconst v = (def as { value: unknown }).value;\n\t\treturn { type: jsonTypeOf(v) as JSONSchema[\"type\"], enum: [v] };\n\t}\n\n\tif (def.typeName === \"ZodEnum\") {\n\t\tconst values = (def as { values: ReadonlyArray<string | number> }).values;\n\t\tconst t = values.every((v) => typeof v === \"number\") ? \"number\" : \"string\";\n\t\treturn { type: t as JSONSchema[\"type\"], enum: [...values] };\n\t}\n\n\tif (def.typeName === \"ZodNativeEnum\") {\n\t\tconst values = (def as { values: Record<string, string | number> }).values;\n\t\tconst entries = Object.entries(values).filter(\n\t\t\t([k, v]) => typeof v !== \"number\" || isNaN(Number(k)),\n\t\t);\n\t\tconst opts = entries.map(([, v]) => v);\n\t\tconst t = opts.every((v) => typeof v === \"number\") ? \"number\" : \"string\";\n\t\treturn { type: t as JSONSchema[\"type\"], enum: opts };\n\t}\n\n\tif (def.typeName === \"ZodObject\") {\n\t\treturn convertObject(schema, def, defs, visited);\n\t}\n\n\tif (def.typeName === \"ZodArray\") {\n\t\treturn convertArray(schema, def, defs, visited);\n\t}\n\n\tif (def.typeName === \"ZodTuple\") {\n\t\tconst items = (def as { items: unknown[] }).items;\n\t\treturn {\n\t\t\ttype: \"array\",\n\t\t\tprefixItems: items.map((s) => zodToJsonSchema(s, { $defs: defs, visited })),\n\t\t\tminItems: items.length,\n\t\t\tmaxItems: items.length,\n\t\t};\n\t}\n\n\tif (def.typeName === \"ZodUnion\" || def.typeName === \"ZodDiscriminatedUnion\") {\n\t\tconst options = (def as { options?: unknown[]; optionsArray?: unknown[] }).options\n\t\t\t?? (def as { optionsArray?: unknown[] }).optionsArray\n\t\t\t?? [];\n\t\treturn {\n\t\t\toneOf: options.map((s) => zodToJsonSchema(s, { $defs: defs, visited })),\n\t\t};\n\t}\n\n\tif (def.typeName === \"ZodDiscriminatedUnion\") {\n\t\tconst discriminator = (def as { discriminator?: string }).discriminator;\n\t\tconst options = (def as { options?: unknown[] }).options ?? [];\n\t\tconst mapping: Record<string, JSONSchema> = {};\n\t\tfor (const opt of options) {\n\t\t\tconst od = readDef(opt);\n\t\t\tif (od.typeName === \"ZodObject\") {\n\t\t\t\tconst shape = (od as { shape: () => Record<string, unknown> }).shape();\n\t\t\t\tconst disc = shape[discriminator ?? \"\"] as { value: unknown } | undefined;\n\t\t\t\tif (disc && \"value\" in disc) {\n\t\t\t\t\tmapping[String(disc.value)] = zodToJsonSchema(opt, { $defs: defs, visited });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\toneOf: Object.values(mapping),\n\t\t\tdiscriminator: { propertyName: discriminator ?? \"type\" },\n\t\t} as JSONSchema;\n\t}\n\n\tif (def.typeName === \"ZodIntersection\") {\n\t\tconst left = (def as { _def?: { left: unknown; right: unknown } })._def?.left\n\t\t\t?? (def as { left: unknown }).left;\n\t\tconst right = (def as { _def?: { left: unknown; right: unknown } })._def?.right\n\t\t\t?? (def as { right: unknown }).right;\n\t\treturn {\n\t\t\tallOf: [\n\t\t\t\tzodToJsonSchema(left, { $defs: defs, visited }),\n\t\t\t\tzodToJsonSchema(right, { $defs: defs, visited }),\n\t\t\t],\n\t\t};\n\t}\n\n\tif (def.typeName === \"ZodRecord\") {\n\t\tconst valueType = (def as { valueType: unknown }).valueType;\n\t\treturn {\n\t\t\ttype: \"object\",\n\t\t\tadditionalProperties: zodToJsonSchema(valueType, { $defs: defs, visited }),\n\t\t};\n\t}\n\n\tif (def.typeName === \"ZodMap\") {\n\t\tconst valueType = (def as { valueType: unknown }).valueType;\n\t\treturn {\n\t\t\ttype: \"object\",\n\t\t\tadditionalProperties: zodToJsonSchema(valueType, { $defs: defs, visited }),\n\t\t};\n\t}\n\n\tif (def.typeName === \"ZodOptional\") {\n\t\tconst inner = (def as { innerType: unknown }).innerType;\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\tif (def.typeName === \"ZodNullable\") {\n\t\tconst inner = (def as { innerType: unknown }).innerType;\n\t\treturn {\n\t\t\t...zodToJsonSchema(inner, { $defs: defs, visited }),\n\t\t\tnullable: true,\n\t\t};\n\t}\n\n\tif (def.typeName === \"ZodDefault\") {\n\t\tconst inner = (def as { innerType: unknown; defaultValue: () => unknown }).innerType;\n\t\tconst dv = (def as { defaultValue: () => unknown }).defaultValue;\n\t\treturn {\n\t\t\t...zodToJsonSchema(inner, { $defs: defs, visited }),\n\t\t\tdefault: safeCall(dv),\n\t\t};\n\t}\n\n\tif (def.typeName === \"ZodCatch\") {\n\t\tconst inner = (def as { innerType: unknown }).innerType;\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\tif (def.typeName === \"ZodBranded\") {\n\t\tconst inner = (def as { type: unknown }).type;\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\tif (def.typeName === \"ZodReadonly\") {\n\t\tconst inner = (def as { innerType: unknown }).innerType;\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\tif (def.typeName === \"ZodLazy\") {\n\t\tconst getter = (def as { getter: () => unknown }).getter;\n\t\tconst inner = safeCall(getter);\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\tif (def.typeName === \"ZodEffects\") {\n\t\tconst inner = (def as { source?: unknown; schema?: unknown; innerType?: unknown }).source\n\t\t\t?? (def as { schema?: unknown }).schema\n\t\t\t?? (def as { innerType?: unknown }).innerType;\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\tif (def.typeName === \"ZodPipeline\") {\n\t\tconst inner = (def as { out: unknown }).out;\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\tif (def.typeName === \"ZodFunction\") return { type: \"null\" };\n\tif (def.typeName === \"ZodPromise\") {\n\t\tconst inner = (def as { innerType: unknown }).innerType;\n\t\treturn zodToJsonSchema(inner, { $defs: defs, visited });\n\t}\n\n\t// Fallback: emit a permissive object schema so the spec is at least\n\t// structurally valid. The user can refine by passing an explicit\n\t// `schema: {...}` on the decorator.\n\treturn {};\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\ntype ZodDef = Record<string, unknown>;\n\nfunction readDef(schema: unknown): ZodDef {\n\tif (typeof schema !== \"object\" || schema === null) return { typeName: \"\" };\n\t// Zod 3 / 3.25: stores everything under `_def`.\n\tconst s = schema as { _def?: ZodDef };\n\tif (s._def && typeof s._def === \"object\") return s._def;\n\t// Fallback: top-level access (some forks).\n\treturn s as ZodDef;\n}\n\nfunction convertString(def: ZodDef): JSONSchema {\n\tconst out: JSONSchema = { type: \"string\" };\n\tconst checks = (def.checks ?? []) as Array<{ kind: string; value?: unknown; regex?: { source: string; flags?: string } }>;\n\tfor (const c of checks) {\n\t\tswitch (c.kind) {\n\t\t\tcase \"email\": out.format = \"email\"; break;\n\t\t\tcase \"url\": out.format = \"uri\"; break;\n\t\t\tcase \"uuid\": out.format = \"uuid\"; break;\n\t\t\tcase \"cuid\":\n\t\t\tcase \"cuid2\": out.format = \"cuid\"; break;\n\t\t\tcase \"emoji\": break;\n\t\t\tcase \"ip\": out.format = \"ipv4\"; break;\n\t\t\tcase \"cidr\": out.format = \"cidr\"; break;\n\t\t\tcase \"datetime\": out.format = \"date-time\"; break;\n\t\t\tcase \"date\": out.format = \"date\"; break;\n\t\t\tcase \"time\": out.format = \"time\"; break;\n\t\t\tcase \"duration\": break;\n\t\t\tcase \"min\":\n\t\t\tcase \"length\": out.minLength = Number(c.value); break;\n\t\t\tcase \"max\": out.maxLength = Number(c.value); break;\n\t\t\tcase \"regex\": if (c.regex) out.pattern = c.regex.source; break;\n\t\t\tcase \"trim\":\n\t\t\tcase \"toLowerCase\":\n\t\t\tcase \"toUpperCase\":\n\t\t\tcase \"startsWith\":\n\t\t\tcase \"endsWith\":\n\t\t\tcase \"includes\":\n\t\t\t\t// No JSON Schema equivalent; ignore.\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn out;\n}\n\nfunction convertNumber(def: ZodDef): JSONSchema {\n\tconst out: JSONSchema = { type: \"number\" };\n\tconst checks = (def.checks ?? []) as Array<{ kind: string; value?: number }>;\n\tlet isInt = false;\n\tfor (const c of checks) {\n\t\tswitch (c.kind) {\n\t\t\tcase \"int\":\n\t\t\tcase \"safeint\": isInt = true; break;\n\t\t\tcase \"min\": out.minimum = c.value; break;\n\t\t\tcase \"max\": out.maximum = c.value; break;\n\t\t\tcase \"finite\":\n\t\t\tcase \"multipleOf\":\n\t\t\t\t// `multipleOf` accepts arbitrary numbers; we skip the\n\t\t\t\t// stricter check that the value is present.\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif (isInt) out.type = \"integer\";\n\treturn out;\n}\n\nfunction convertObject(\n\t_schema: unknown,\n\tdef: ZodDef,\n\tdefs: Record<string, JSONSchema>,\n\tvisited: WeakSet<object>,\n): JSONSchema {\n\tconst shapeFn = (def as { shape?: unknown }).shape;\n\tconst shape = typeof shapeFn === \"function\" ? (shapeFn as () => Record<string, unknown>)() : shapeFn;\n\tconst properties: Record<string, JSONSchema> = {};\n\tconst required: string[] = [];\n\tconst catchall = (def as { catchall?: unknown }).catchall;\n\tif (shape && typeof shape === \"object\") {\n\t\tfor (const [key, value] of Object.entries(shape)) {\n\t\t\tconst child = zodToJsonSchema(value, { $defs: defs, visited });\n\t\t\tconst childDef = readDef(value);\n\t\t\t// Zod: optional / nullable / default are NOT in `required`.\n\t\t\tconst isOptional =\n\t\t\t\tchildDef.typeName === \"ZodOptional\" ||\n\t\t\t\tchildDef.typeName === \"ZodDefault\" ||\n\t\t\t\tchildDef.typeName === \"ZodCatch\";\n\t\t\tproperties[key] = child;\n\t\t\tif (!isOptional) required.push(key);\n\t\t}\n\t}\n\tconst description = (def as { description?: string }).description;\n\tconst out: JSONSchema = { type: \"object\", properties };\n\tif (required.length > 0) out.required = required;\n\tif (typeof catchall === \"object\" && catchall !== null) {\n\t\tconst c = readDef(catchall);\n\t\t// `ZodNever` catchall = strict; `ZodAny`/`ZodUnknown` = passthrough.\n\t\tif (c.typeName === \"ZodNever\") out.additionalProperties = false;\n\t\telse out.additionalProperties = true;\n\t}\n\tif (description) out.description = description;\n\treturn out;\n}\n\nfunction convertArray(\n\t_schema: unknown,\n\tdef: ZodDef,\n\tdefs: Record<string, JSONSchema>,\n\tvisited: WeakSet<object>,\n): JSONSchema {\n\tconst out: JSONSchema = { type: \"array\" };\n\tconst element = (def as { element?: unknown; type?: unknown }).element\n\t\t?? (def as { type?: unknown }).type;\n\tif (element) out.items = zodToJsonSchema(element, { $defs: defs, visited });\n\tconst checks = (def as { minLength?: { value: number }; maxLength?: { value: number } });\n\tif (checks.minLength?.value != null) out.minItems = checks.minLength.value;\n\tif (checks.maxLength?.value != null) out.maxItems = checks.maxLength.value;\n\treturn out;\n}\n\nfunction jsonTypeOf(v: unknown): \"string\" | \"number\" | \"boolean\" | \"object\" | \"null\" {\n\tif (v === null) return \"null\";\n\tif (typeof v === \"string\") return \"string\";\n\tif (typeof v === \"number\") return \"number\";\n\tif (typeof v === \"boolean\") return \"boolean\";\n\treturn \"object\";\n}\n\nfunction safeCall<T>(fn: unknown): T {\n\ttry {\n\t\treturn (fn as () => T)();\n\t} catch {\n\t\treturn undefined as unknown as T;\n\t}\n}",
|
|
9
|
-
"/**\n *
|
|
9
|
+
"/**\n * Shared dual-mode metadata helpers for OpenAPI decorators.\n *\n * In standard mode (TC39), method decorators receive `(fn, context)`.\n * `fn.constructor` is `Function`, not the class. We stash metadata\n * directly on the function using a Symbol key.\n *\n * In legacy mode, decorators receive `(target, propertyKey)` where\n * `target` is the prototype. We use `safeDefineMeta` on the constructor.\n */\nimport { safeGetMeta } from \"@nexusts/core/di/safe-reflect\";\n\n/** Symbol key used to stash decorator metadata on method functions. */\nconst FN_META_KEY = Symbol.for(\"nexus:openapi:fn:meta\");\n\n/**\n * Store metadata in standard mode — stashes on the function.\n */\nexport function storeMethodMetaStandard(\n\tfn: any,\n\tmetaKey: string,\n\tvalue: unknown,\n): void {\n\tif (!(fn as any)[FN_META_KEY]) (fn as any)[FN_META_KEY] = {};\n\t(fn as any)[FN_META_KEY][metaKey] = value;\n}\n\n/**\n * Read metadata that may have been stored via standard or legacy mode.\n */\nexport function readMethodMeta<T>(\n\tmetaKey: string,\n\tctor: any,\n\tpropKey: string | symbol,\n): T | undefined {\n\t// Legacy: check safeGetMeta on constructor (if ctor is a valid target).\n\tif (ctor && typeof ctor === \"function\") {\n\t\ttry {\n\t\t\tconst fromLegacy = safeGetMeta(metaKey, ctor, propKey) as T | undefined;\n\t\t\tif (fromLegacy !== undefined) return fromLegacy;\n\t\t} catch {\n\t\t\t// Ignore — target may not support metadata storage.\n\t\t}\n\t}\n\t// Standard: check the prototype function for stashed data\n\tif (ctor?.prototype) {\n\t\tconst fn = ctor.prototype[propKey];\n\t\tif (typeof fn === \"function\") {\n\t\t\tconst stashed = (fn as any)[FN_META_KEY]?.[metaKey];\n\t\t\tif (stashed !== undefined) return stashed as T;\n\t\t}\n\t}\n\treturn undefined;\n}\n",
|
|
10
|
+
"/**\n * `OpenAPIModule` — drop-in OpenAPI 3.1 + Scalar UI.\n *\n * @Module({\n * imports: [\n * OpenAPIModule.forRoot({\n * info: { title: 'My API', version: '1.0.0' },\n * servers: [{ url: 'http://localhost:3000' }],\n * }),\n * ],\n * })\n * export class AppModule {}\n *\n * After boot, the framework exposes:\n *\n * GET /openapi.json — the OpenAPI 3.1 spec\n * GET /docs — the Scalar UI\n *\n * To feed routes to the spec, the application must call\n * `OpenAPIService.setRoutes(...)` after the router is built. The\n * recommended way is to read routes from the `NexusServer` instance\n * inside the module's onModuleInit hook (see the helper below).\n */\nimport { Module } from \"@nexusts/core\";\nimport { OpenAPIService } from \"./openapi.service.js\";\nimport type { OpenAPIConfig } from \"./types.js\";\n\n@Module({\n\tproviders: [\n\t\tOpenAPIService,\n\t\t{ provide: OpenAPIService.TOKEN, useExisting: OpenAPIService },\n\t],\n\texports: [OpenAPIService, OpenAPIService.TOKEN],\n})\nexport class OpenAPIModule {\n\tstatic forRoot(config: OpenAPIConfig) {\n\t\t@Module({\n\t\t\tproviders: [\n\t\t\t\tOpenAPIService,\n\t\t\t\t{ provide: OpenAPIService.TOKEN, useExisting: OpenAPIService },\n\t\t\t\t{ provide: \"OPENAPI_CONFIG\", useValue: config },\n\t\t\t],\n\t\t\texports: [OpenAPIService, OpenAPIService.TOKEN],\n\t\t})\n\t\tclass ConfiguredOpenAPIModule {}\n\t\tObject.defineProperty(ConfiguredOpenAPIModule, \"name\", {\n\t\t\tvalue: \"ConfiguredOpenAPIModule\",\n\t\t});\n\t\treturn ConfiguredOpenAPIModule;\n\t}\n\n\t/**\n\t * Mount the spec + Scalar UI on an existing Hono app. The user\n\t * calls this once, after the framework's router is built, passing\n\t * the route list.\n\t *\n\t * import { mountOpenAPI } from '@nexusts/openapi';\n\t * const openapi = new OpenAPIService(config);\n\t * openapi.setRoutes(routes);\n\t * mountOpenAPI(app, openapi, config);\n\t */\n\tstatic mount(\n\t\tapp: { use: (path: string, ...handlers: any[]) => any; get: (path: string, ...handlers: any[]) => any },\n\t\tsvc: OpenAPIService,\n\t\tconfig: OpenAPIConfig,\n\t): void {\n\t\tconst specPath = config.specPath ?? \"/openapi.json\";\n\t\tconst docsPath = config.path ?? \"/docs\";\n\t\t// The route handlers are evaluated lazily at request time.\n\t\tapp.get(specPath, (c: any) => c.json(svc.getSpec(), 200, { \"Content-Type\": \"application/json\" }));\n\t\tapp.get(docsPath, (c: any) => {\n\t\t\t// We import lazily to avoid a circular dep.\n\t\t\tconst { scalarHtml } = require(\"./scalar.js\") as typeof import(\"./scalar.js\");\n\t\t\tconst html = scalarHtml({\n\t\t\t\ttitle: config.info.title,\n\t\t\t\tspecUrl: specPath,\n\t\t\t});\n\t\t\treturn c.html(html, 200, { \"Content-Type\": \"text/html; charset=utf-8\" });\n\t\t});\n\t}\n}",
|
|
10
11
|
"/**\n * `@ApiTags('Users', 'Admin')` — group operations under one or more\n * tags in the OpenAPI spec.\n */\nimport { safeGetMeta, safeDefineMeta } from \"@nexusts/core/di/safe-reflect\";\nimport { OPENAPI_META } from \"../types.js\";\n\nexport function ApiTags(...tags: string[]): ClassDecorator {\n\treturn (target: any) => {\n\t\tconst existing: string[] = safeGetMeta(OPENAPI_META.TAGS, target) ?? [];\n\t\tsafeDefineMeta(OPENAPI_META.TAGS, [...existing, ...tags], target);\n\t};\n}\n",
|
|
11
|
-
"/**\n * `@ApiOperation({ summary, description, operationId, tags, deprecated })`\n *\n * Decorate a controller method to describe the operation in the spec.\n */\nimport { OPENAPI_META, type ApiOperationOptions } from \"../types.js\";\nimport {
|
|
12
|
-
"/**\n * `@ApiResponse(200, { description: 'OK', schema: UserSchema })`\n *\n * Decorate a controller method to describe one of its responses.\n * Multiple `@ApiResponse` calls accumulate.\n */\nimport { OPENAPI_META, type ApiResponseOptions } from \"../types.js\";\nimport { safeGetMeta, safeDefineMeta
|
|
13
|
-
"/**\n * `@ApiParam({ name, description, required, schema })` — document a\n * path parameter. The decorator is optional — the spec builder\n * auto-derives path params from
|
|
14
|
-
"/**\n * `@ApiBody({ description, required, schema })` — document the request\n * body. Auto-derivation from `@Validate({ body })` runs first; explicit\n * `@ApiBody` decorators take precedence.\n */\nimport { OPENAPI_META, type ApiBodyOptions } from \"../types.js\";\nimport {
|
|
12
|
+
"/**\n * `@ApiOperation({ summary, description, operationId, tags, deprecated })`\n *\n * Decorate a controller method to describe the operation in the spec.\n *\n * Dual-mode: supports TC39 standard ES decorators + legacy.\n */\nimport { OPENAPI_META, type ApiOperationOptions } from \"../types.js\";\nimport { safeDefineMeta } from \"@nexusts/core/di/safe-reflect\";\nimport { storeMethodMetaStandard } from \"./standard-meta.js\";\n\nexport function ApiOperation(options: ApiOperationOptions): any {\n\treturn function (this: any, targetOrFn: any, contextOrKey?: any): void {\n\t\tif (contextOrKey?.kind === \"method\") {\n\t\t\tconst { name, metadata } = contextOrKey;\n\t\t\tmetadata[OPENAPI_META.OPERATION] = options;\n\t\t\tstoreMethodMetaStandard(targetOrFn, OPENAPI_META.OPERATION, options);\n\t\t\treturn;\n\t\t}\n\t\tconst target = targetOrFn;\n\t\tconst propertyKey = contextOrKey as string | symbol;\n\t\tsafeDefineMeta(OPENAPI_META.OPERATION, options, target.constructor, propertyKey);\n\t};\n}\n",
|
|
13
|
+
"/**\n * `@ApiResponse(200, { description: 'OK', schema: UserSchema })`\n *\n * Decorate a controller method to describe one of its responses.\n * Multiple `@ApiResponse` calls accumulate.\n *\n * Dual-mode: supports TC39 standard ES decorators + legacy.\n */\nimport { OPENAPI_META, type ApiResponseOptions } from \"../types.js\";\nimport { safeGetMeta, safeDefineMeta } from \"@nexusts/core/di/safe-reflect\";\nimport { storeMethodMetaStandard } from \"./standard-meta.js\";\n\nexport function ApiResponse(\n\tstatus: number | string,\n\toptions: ApiResponseOptions,\n): any {\n\tconst entry: [string, ApiResponseOptions] = [String(status), options];\n\treturn function (this: any, targetOrFn: any, contextOrKey?: any): void {\n\t\tif (contextOrKey?.kind === \"method\") {\n\t\t\tconst { name, metadata } = contextOrKey;\n\t\t\tconst existing: Array<[string, ApiResponseOptions]> =\n\t\t\t\t(metadata[OPENAPI_META.RESPONSES] as Array<[string, ApiResponseOptions]>) ?? [];\n\t\t\texisting.push(entry);\n\t\t\tmetadata[OPENAPI_META.RESPONSES] = existing;\n\t\t\tstoreMethodMetaStandard(targetOrFn, OPENAPI_META.RESPONSES, existing);\n\t\t\treturn;\n\t\t}\n\t\tconst target = targetOrFn;\n\t\tconst propertyKey = contextOrKey as string | symbol;\n\t\tconst existing: Array<[string, ApiResponseOptions]> =\n\t\t\tsafeGetMeta(OPENAPI_META.RESPONSES, target.constructor, propertyKey) ?? [];\n\t\texisting.push(entry);\n\t\tsafeDefineMeta(OPENAPI_META.RESPONSES, existing, target.constructor, propertyKey);\n\t};\n}\n",
|
|
14
|
+
"/**\n * `@ApiParam({ name, description, required, schema })` — document a\n * path parameter. The decorator is optional — the spec builder\n * auto-derives path params from route patterns (`/users/:id` → `id`).\n * Use this when you want to override the schema or add a description.\n *\n * `@ApiQuery({ name, description, schema })` — document a query param.\n *\n * Both are dual-mode (TC39 standard + legacy).\n */\nimport { OPENAPI_META, type ApiParamOptions } from \"../types.js\";\nimport { safeGetMeta, safeDefineMeta } from \"@nexusts/core/di/safe-reflect\";\nimport { storeMethodMetaStandard } from \"./standard-meta.js\";\n\nfunction makeParamDecorator(metaKey: string): (options: ApiParamOptions) => any {\n\treturn (options: ApiParamOptions) => {\n\t\treturn function (this: any, targetOrFn: any, contextOrKey?: any): void {\n\t\t\tif (contextOrKey?.kind === \"method\") {\n\t\t\t\tconst { name, metadata } = contextOrKey;\n\t\t\t\tconst existing: ApiParamOptions[] = (metadata[metaKey] as ApiParamOptions[]) ?? [];\n\t\t\t\texisting.push(options);\n\t\t\t\tmetadata[metaKey] = existing;\n\t\t\t\tstoreMethodMetaStandard(targetOrFn, metaKey, existing);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst target = targetOrFn;\n\t\t\tconst propertyKey = contextOrKey as string | symbol;\n\t\t\tconst existing: ApiParamOptions[] =\n\t\t\t\tsafeGetMeta(metaKey, target.constructor, propertyKey) ?? [];\n\t\t\texisting.push(options);\n\t\t\tsafeDefineMeta(metaKey, existing, target.constructor, propertyKey);\n\t\t};\n\t};\n}\n\nexport const ApiParam = makeParamDecorator(OPENAPI_META.PARAMS);\nexport const ApiQuery = makeParamDecorator(OPENAPI_META.QUERIES);\n",
|
|
15
|
+
"/**\n * `@ApiBody({ description, required, schema })` — document the request\n * body. Auto-derivation from `@Validate({ body })` runs first; explicit\n * `@ApiBody` decorators take precedence.\n *\n * Dual-mode: supports TC39 standard ES decorators + legacy.\n */\nimport { OPENAPI_META, type ApiBodyOptions } from \"../types.js\";\nimport { safeDefineMeta } from \"@nexusts/core/di/safe-reflect\";\nimport { storeMethodMetaStandard } from \"./standard-meta.js\";\n\nexport function ApiBody(options: ApiBodyOptions): any {\n\treturn function (this: any, targetOrFn: any, contextOrKey?: any): void {\n\t\tif (contextOrKey?.kind === \"method\") {\n\t\t\tconst { name, metadata } = contextOrKey;\n\t\t\tmetadata[OPENAPI_META.BODY] = options;\n\t\t\tstoreMethodMetaStandard(targetOrFn, OPENAPI_META.BODY, options);\n\t\t\treturn;\n\t\t}\n\t\tconst target = targetOrFn;\n\t\tconst propertyKey = contextOrKey as string | symbol;\n\t\tsafeDefineMeta(OPENAPI_META.BODY, options, target.constructor, propertyKey);\n\t};\n}\n",
|
|
15
16
|
"/**\n * `@ApiProperty({ description, required, schema, example })` — document\n * a property on a request / response DTO.\n *\n * ```ts\n * class UserDto {\n * @ApiProperty({ description: 'Unique user id', example: 42 })\n * id!: number;\n *\n * @ApiProperty({ description: 'Email address', required: true })\n * email!: string;\n * }\n * ```\n *\n * The `schema` field accepts either a Zod schema or a pre-computed\n * `JSONSchema`. Without a `schema`, the type is inferred from the\n * TypeScript reflection of the property's design:type metadata.\n */\nimport { OPENAPI_META, type ApiPropertyOptions } from \"../types.js\";\nimport { safeGetMeta, safeDefineMeta, safeHasMeta } from \"@nexusts/core/di/safe-reflect\";\n\nexport function ApiProperty(options: ApiPropertyOptions = {}): PropertyDecorator {\n\treturn (target: object, propertyKey: string | symbol) => {\n\t\tconst existing: Record<string | symbol, ApiPropertyOptions> =\n\t\t\tsafeGetMeta(OPENAPI_META.PROPERTIES, target.constructor) ?? {};\n\t\texisting[propertyKey] = options;\n\t\tsafeDefineMeta(OPENAPI_META.PROPERTIES, existing, target.constructor);\n\t};\n}\n\n/** Class-level: mark a DTO class so its properties can be lifted into a schema. */\nexport function ApiSchema(name: string): ClassDecorator {\n\treturn (target: any) => {\n\t\tsafeDefineMeta(\"nexus:openapi:schemaName\", name, target);\n\t};\n}",
|
|
16
17
|
"/**\n * `@ApiSecurity('bearerAuth', [])` — declare the security requirements\n * for an operation or controller.\n */\nimport { OPENAPI_META, type ApiSecurityOptions } from \"../types.js\";\nimport { safeGetMeta, safeDefineMeta, safeHasMeta } from \"@nexusts/core/di/safe-reflect\";\n\nexport function ApiSecurity(name: string, scopes: string[] = []): ClassDecorator & MethodDecorator {\n\treturn (\n\t\ttarget: any,\n\t\t_propertyKey?: string | symbol,\n\t\t_descriptor?: PropertyDescriptor,\n\t) => {\n\t\t// Class or method — store the same way.\n\t\tconst key = OPENAPI_META.SECURITY;\n\t\tconst existing: ApiSecurityOptions[] =\n\t\t\t(typeof _propertyKey === \"string\" || typeof _propertyKey === \"symbol\")\n\t\t\t\t? safeGetMeta(key, target.constructor, _propertyKey) ?? []\n\t\t\t\t: safeGetMeta(key, target) ?? [];\n\t\texisting.push({ [name]: scopes });\n\t\tif (typeof _propertyKey === \"string\" || typeof _propertyKey === \"symbol\") {\n\t\t\tsafeDefineMeta(key, existing, target.constructor, _propertyKey);\n\t\t} else {\n\t\t\tsafeDefineMeta(key, existing, target);\n\t\t}\n\t};\n}\n\n/** `@ApiExclude()` — exclude a route from the spec. */\nexport function ApiExclude(): MethodDecorator {\n\treturn (target: object, propertyKey: string | symbol) => {\n\t\tsafeDefineMeta(OPENAPI_META.EXCLUDE, true, target.constructor, propertyKey);\n\t};\n}\n"
|
|
17
18
|
],
|
|
18
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,UAAU,CAAC,MAAiN;AAAA,EAC3O,MAAM,QAAQ,WAAW,KAAK,KAAK;AAAA,EACnC,MAAM,QAAQ,KAAK,SAAS;AAAA,EAC5B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,WAKG;AAAA,wDAC6C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAUxC,WAAW,KAAK,OAAO;AAAA,0BACb,kBAAkB,KAAK,UAAU,EAAE,OAAO,kBAAkB,KAAK,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO7F,SAAS,UAAU,CAAC,GAAmB;AAAA,EACtC,OAAO,EACL,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAAA;AAOxB,SAAS,iBAAiB,CAAC,GAAmB;AAAA,EAC7C,OAAO,EAAE,QAAQ,MAAM,OAAO,EAAE,QAAQ,MAAM,MAAM;AAAA;;;AC6N9C,IAAM,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QA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,MAAM,aAAa;AAAA,IACzB,MAAM,WACJ,OAAO,iBAAiB,YAAY,OAAO,iBAAiB,WAC1D,aAAY,KAAK,OAAO,aAAa,YAAY,KAAK,CAAC,IACvD,aAAY,KAAK,MAAM,KAAK,CAAC;AAAA,IACjC,SAAS,KAAK,GAAG,OAAO,OAAO,CAAC;AAAA,IAChC,IAAI,OAAO,iBAAiB,YAAY,OAAO,iBAAiB,UAAU;AAAA,MACzE,gBAAe,KAAK,UAAU,OAAO,aAAa,YAAY;AAAA,IAC/D,EAAO;AAAA,MACN,gBAAe,KAAK,UAAU,MAAM;AAAA;AAAA;AAAA;AAMhC,SAAS,UAAU,GAAoB;AAAA,EAC7C,OAAO,CAAC,QAAgB,gBAAiC;AAAA,IACxD,gBAAe,aAAa,SAAS,MAAM,OAAO,aAAa,WAAW;AAAA;AAAA;",
|
|
20
|
+
"debugId": "C7EE9912882E846664756E2164756E21",
|
|
20
21
|
"names": []
|
|
21
22
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { JSONSchema,
|
|
1
|
+
import type { JSONSchema, OpenAPIDocument } from "./types.js";
|
|
2
2
|
export declare class OpenAPIService {
|
|
3
3
|
#private;
|
|
4
4
|
/** DI token. */
|
|
5
5
|
static readonly TOKEN: unique symbol;
|
|
6
|
-
|
|
6
|
+
/** OpenAPI config — injected by DI container. */
|
|
7
|
+
private _injectConfig;
|
|
8
|
+
constructor();
|
|
7
9
|
/**
|
|
8
10
|
* Inject the route list. The framework's router calls this on boot.
|
|
9
11
|
* Each entry is the data needed to emit one OpenAPI operation.
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexusts/openapi",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "OpenAPI 3.1 spec generation from Zod",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@nexusts/core": "^0.9.
|
|
29
|
+
"@nexusts/core": "^0.9.8"
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|