adorn-api 1.0.26 → 1.0.27

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.
@@ -83,7 +83,7 @@ function createMetalCrudDtoClasses(target, options = {}) {
83
83
  return classes;
84
84
  }
85
85
  function createNestedCreateDtoClass(target, overrides, options) {
86
- const { additionalExclude, name, parentEntity, ...metalDtoOptions } = options;
86
+ const { additionalExclude, name, parentEntity: _parentEntity, ...metalDtoOptions } = options;
87
87
  const allExcludes = mergeStringArrays(["id", "createdAt"], additionalExclude, metalDtoOptions.exclude);
88
88
  let NestedCreateDto = (() => {
89
89
  let _classDecorators = [(0, dto_1.MetalDto)(target, {
@@ -39,7 +39,7 @@ exports.createErrorDtoClass = createErrorDtoClass;
39
39
  const decorators_1 = require("../../core/decorators");
40
40
  const schema_1 = require("../../core/schema");
41
41
  function createErrorDtoClass(options = {}) {
42
- const { withDetails = true, includeTraceId = true } = options;
42
+ const { withDetails = true, includeTraceId: _includeTraceId = true } = options;
43
43
  if (withDetails) {
44
44
  let ErrorDetailDto = (() => {
45
45
  let _classDecorators = [(0, decorators_1.Dto)()];
@@ -12,6 +12,12 @@ const dtoStore = new Map();
12
12
  const controllerStore = new Map();
13
13
  exports.META_KEY = Symbol.for("adorn.metadata");
14
14
  function getAdornMetadata(metadata) {
15
+ // Handle case where metadata is undefined (when Symbol.metadata is not available)
16
+ if (!metadata) {
17
+ const temp = {};
18
+ temp[exports.META_KEY] = {};
19
+ return temp[exports.META_KEY];
20
+ }
15
21
  if (!metadata[exports.META_KEY]) {
16
22
  metadata[exports.META_KEY] = {};
17
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adorn-api",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Decorator-first web framework with OpenAPI 3.1 schema generation.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- import { Dto } from "../../core/decorators";
1
+
2
2
  import type { DtoConstructor } from "../../core/types";
3
3
  import { MetalDto } from "./dto";
4
4
  import type {
@@ -70,7 +70,7 @@ export function createNestedCreateDtoClass(
70
70
  overrides: Record<string, any>,
71
71
  options: NestedCreateDtoOptions
72
72
  ): DtoConstructor {
73
- const { additionalExclude, name, parentEntity, ...metalDtoOptions } = options;
73
+ const { additionalExclude, name, parentEntity: _parentEntity, ...metalDtoOptions } = options;
74
74
 
75
75
  const allExcludes = mergeStringArrays(
76
76
  ["id", "createdAt"],
@@ -4,7 +4,7 @@ import type { ErrorDtoOptions } from "./types";
4
4
  import { t } from "../../core/schema";
5
5
 
6
6
  export function createErrorDtoClass(options: ErrorDtoOptions = {}): DtoConstructor {
7
- const { withDetails = true, includeTraceId = true } = options;
7
+ const { withDetails = true, includeTraceId: _includeTraceId = true } = options;
8
8
 
9
9
  if (withDetails) {
10
10
  @Dto()
@@ -1,4 +1,4 @@
1
- import type { Filter, FilterMapping, ParseFilterOptions } from "./types";
1
+ import type { Filter } from "./types";
2
2
 
3
3
  /**
4
4
  * Parses filter parameters from query parameters.
@@ -1,6 +1,6 @@
1
1
  import { Dto, Field } from "../../core/decorators";
2
2
  import type { DtoConstructor } from "../../core/types";
3
- import type { SchemaNode } from "../../core/schema";
3
+
4
4
  import { t } from "../../core/schema";
5
5
  import type { FieldMeta } from "../../core/metadata";
6
6
  import { registerDto } from "../../core/metadata";
@@ -1,4 +1,4 @@
1
- import type { PaginationConfig, PaginationOptions, ParsedPagination } from "./types";
1
+ import type { PaginationConfig, ParsedPagination } from "./types";
2
2
  import { coerce } from "../../core/coerce";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { ColumnDef } from "metal-orm";
1
+
2
2
  import type { DtoOptions, FieldOverride } from "../../core/decorators";
3
3
  import type { SchemaNode } from "../../core/schema";
4
4
  import type { DtoConstructor } from "../../core/types";
@@ -79,6 +79,13 @@ export interface RouteMetaInput extends Partial<RouteMeta> {
79
79
  }
80
80
 
81
81
  export function getAdornMetadata(metadata: DecoratorMetadata): AdornMetadata {
82
+ // Handle case where metadata is undefined (when Symbol.metadata is not available)
83
+ if (!metadata) {
84
+ const temp: any = {};
85
+ temp[META_KEY] = {};
86
+ return temp[META_KEY];
87
+ }
88
+
82
89
  if (!metadata[META_KEY]) {
83
90
  metadata[META_KEY] = {};
84
91
  }
package/vitest.config.ts CHANGED
@@ -1,8 +1,14 @@
1
- import { defineConfig } from "vitest/config";
2
-
3
- export default defineConfig({
4
- test: {
5
- environment: "node",
6
- include: ["src/**/*.test.ts"]
7
- }
8
- });
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "node",
6
+ include: ["src/**/*.test.ts"],
7
+ pool: "forks",
8
+ poolOptions: {
9
+ forks: {
10
+ singleFork: true
11
+ }
12
+ }
13
+ }
14
+ });