adorn-api 1.0.2 → 1.0.4
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/core/binding/binder.d.ts +1 -1
- package/dist/core/binding/binder.js +1 -1
- package/dist/core/errors/validation-error.d.ts +1 -1
- package/dist/core/errors/validation-error.js +1 -1
- package/dist/core/reply/typed.d.ts +1 -1
- package/dist/core/reply/typed.js +1 -1
- package/dist/decorators/methods.d.ts +3 -3
- package/dist/decorators/methods.js +3 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/integrations/metal-orm/schema/entity.d.ts +1 -1
- package/dist/integrations/metal-orm/schema/entity.js +1 -1
- package/package.json +1 -1
|
@@ -61,7 +61,7 @@ export type BindOptions = {
|
|
|
61
61
|
* ```typescript
|
|
62
62
|
* // For a POST route with body
|
|
63
63
|
* // @Post('/users')
|
|
64
|
-
* // async createUser(
|
|
64
|
+
* // async createUser(userData: CreateUserDto)
|
|
65
65
|
* const { args } = bindArgs(route, handler, requestContext);
|
|
66
66
|
* const result = await handler(...args); // Automatically passes parsed body
|
|
67
67
|
* ```
|
|
@@ -27,7 +27,7 @@ import { coerceObjectSmart, coerceValueSmart } from './coerce/arrays.js';
|
|
|
27
27
|
* ```typescript
|
|
28
28
|
* // For a POST route with body
|
|
29
29
|
* // @Post('/users')
|
|
30
|
-
* // async createUser(
|
|
30
|
+
* // async createUser(userData: CreateUserDto)
|
|
31
31
|
* const { args } = bindArgs(route, handler, requestContext);
|
|
32
32
|
* const result = await handler(...args); // Automatically passes parsed body
|
|
33
33
|
* ```
|
|
@@ -33,7 +33,7 @@ import type { ValidationIssue } from '../../contracts/validator.js';
|
|
|
33
33
|
* ```typescript
|
|
34
34
|
* // In a controller with validation
|
|
35
35
|
* @Post('/users')
|
|
36
|
-
* async createUser(
|
|
36
|
+
* async createUser(userData: CreateUserDto) {
|
|
37
37
|
* const validationResult = await validator.validate(userData);
|
|
38
38
|
*
|
|
39
39
|
* if (!validationResult.valid) {
|
|
@@ -32,7 +32,7 @@ import { HttpError } from './http-error.js';
|
|
|
32
32
|
* ```typescript
|
|
33
33
|
* // In a controller with validation
|
|
34
34
|
* @Post('/users')
|
|
35
|
-
* async createUser(
|
|
35
|
+
* async createUser(userData: CreateUserDto) {
|
|
36
36
|
* const validationResult = await validator.validate(userData);
|
|
37
37
|
*
|
|
38
38
|
* if (!validationResult.valid) {
|
|
@@ -90,7 +90,7 @@ type InitFor<R extends ResponsesSpec, S extends number> = Omit<ReplyInit, 'heade
|
|
|
90
90
|
*
|
|
91
91
|
* class UserController {
|
|
92
92
|
* @Post('/users')
|
|
93
|
-
* async createUser(
|
|
93
|
+
* async createUser(userData: CreateUserDto) {
|
|
94
94
|
* const createdUser = await userService.create(userData);
|
|
95
95
|
* return route.reply(201, createdUser); // Type-safe!
|
|
96
96
|
* }
|
package/dist/core/reply/typed.js
CHANGED
|
@@ -77,7 +77,7 @@ import { reply as baseReply, noContent as baseNoContent } from './reply.js';
|
|
|
77
77
|
*
|
|
78
78
|
* class UserController {
|
|
79
79
|
* @Post('/users')
|
|
80
|
-
* async createUser(
|
|
80
|
+
* async createUser(userData: CreateUserDto) {
|
|
81
81
|
* const createdUser = await userService.create(userData);
|
|
82
82
|
* return route.reply(201, createdUser); // Type-safe!
|
|
83
83
|
* }
|
|
@@ -55,7 +55,7 @@ export declare function Get<Path extends string, const O extends RouteOptions<Pa
|
|
|
55
55
|
* ```typescript
|
|
56
56
|
* class UserController {
|
|
57
57
|
* @Post('/users')
|
|
58
|
-
* async createUser(
|
|
58
|
+
* async createUser(userData: CreateUserDto) {
|
|
59
59
|
* return await userService.create(userData);
|
|
60
60
|
* }
|
|
61
61
|
*
|
|
@@ -82,7 +82,7 @@ export declare function Post<Path extends string, const O extends RouteOptions<P
|
|
|
82
82
|
* ```typescript
|
|
83
83
|
* class UserController {
|
|
84
84
|
* @Put('/users/:id')
|
|
85
|
-
* async updateUser(id: string,
|
|
85
|
+
* async updateUser(id: string, userData: UpdateUserDto) {
|
|
86
86
|
* return await userService.update(id, userData);
|
|
87
87
|
* }
|
|
88
88
|
* }
|
|
@@ -104,7 +104,7 @@ export declare function Put<Path extends string, const O extends RouteOptions<Pa
|
|
|
104
104
|
* ```typescript
|
|
105
105
|
* class UserController {
|
|
106
106
|
* @Patch('/users/:id')
|
|
107
|
-
* async partialUpdate(id: string,
|
|
107
|
+
* async partialUpdate(id: string, partialData: Partial<User>) {
|
|
108
108
|
* return await userService.patch(id, partialData);
|
|
109
109
|
* }
|
|
110
110
|
* }
|
|
@@ -72,7 +72,7 @@ export function Get(path, options) {
|
|
|
72
72
|
* ```typescript
|
|
73
73
|
* class UserController {
|
|
74
74
|
* @Post('/users')
|
|
75
|
-
* async createUser(
|
|
75
|
+
* async createUser(userData: CreateUserDto) {
|
|
76
76
|
* return await userService.create(userData);
|
|
77
77
|
* }
|
|
78
78
|
*
|
|
@@ -101,7 +101,7 @@ export function Post(path, options) {
|
|
|
101
101
|
* ```typescript
|
|
102
102
|
* class UserController {
|
|
103
103
|
* @Put('/users/:id')
|
|
104
|
-
* async updateUser(id: string,
|
|
104
|
+
* async updateUser(id: string, userData: UpdateUserDto) {
|
|
105
105
|
* return await userService.update(id, userData);
|
|
106
106
|
* }
|
|
107
107
|
* }
|
|
@@ -125,7 +125,7 @@ export function Put(path, options) {
|
|
|
125
125
|
* ```typescript
|
|
126
126
|
* class UserController {
|
|
127
127
|
* @Patch('/users/:id')
|
|
128
|
-
* async partialUpdate(id: string,
|
|
128
|
+
* async partialUpdate(id: string, partialData: Partial<User>) {
|
|
129
129
|
* return await userService.patch(id, partialData);
|
|
130
130
|
* }
|
|
131
131
|
* }
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export
|
|
1
|
+
export * from './decorators/index.js';
|
|
2
|
+
export { HttpError, ValidationError } from './core/errors/index.js';
|
|
3
|
+
export { toProblemDetails } from './core/errors/index.js';
|
|
3
4
|
export * from './validation/native/index.js';
|
|
4
5
|
export * from './core/openapi/index.js';
|
|
5
6
|
export * from './contracts/openapi.js';
|
|
@@ -10,4 +11,5 @@ export * from './core/route/index.js';
|
|
|
10
11
|
export * from './core/registry/index.js';
|
|
11
12
|
export * from './contracts/route-options.js';
|
|
12
13
|
export * from './contracts/route-typing.js';
|
|
14
|
+
export * from './contracts/validator.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,cAAc,8BAA8B,CAAC;AAG7C,cAAc,yBAAyB,CAAC;AAGxC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAG5C,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Public API exports for adorn-api
|
|
2
|
+
// This file defines the stable public API surface that users can rely on
|
|
3
|
+
// Core decorators - these are the main public API
|
|
4
|
+
export * from './decorators/index.js';
|
|
5
|
+
// Error types - public error classes
|
|
6
|
+
export { HttpError, ValidationError } from './core/errors/index.js';
|
|
7
|
+
export { toProblemDetails } from './core/errors/index.js';
|
|
8
|
+
// Validation - public validation API
|
|
3
9
|
export * from './validation/native/index.js';
|
|
10
|
+
// OpenAPI generation - public API for generating OpenAPI docs
|
|
4
11
|
export * from './core/openapi/index.js';
|
|
12
|
+
// OpenAPI contracts - public types for OpenAPI
|
|
5
13
|
export * from './contracts/openapi.js';
|
|
14
|
+
// Response handling - public API for responses
|
|
6
15
|
export * from './contracts/responses.js';
|
|
7
16
|
export * from './contracts/reply.js';
|
|
8
17
|
export * from './core/reply/index.js';
|
|
18
|
+
// Route definitions - public API for route configuration
|
|
9
19
|
export * from './core/route/index.js';
|
|
20
|
+
// Registry types - public types for the registry system
|
|
10
21
|
export * from './core/registry/index.js';
|
|
22
|
+
// Route options and typing - public API for route configuration
|
|
11
23
|
export * from './contracts/route-options.js';
|
|
12
24
|
export * from './contracts/route-typing.js';
|
|
25
|
+
// Validator contracts - public validation types
|
|
26
|
+
export * from './contracts/validator.js';
|
|
13
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,yEAAyE;AAEzE,kDAAkD;AAClD,cAAc,uBAAuB,CAAC;AAEtC,qCAAqC;AACrC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,qCAAqC;AACrC,cAAc,8BAA8B,CAAC;AAE7C,8DAA8D;AAC9D,cAAc,yBAAyB,CAAC;AAExC,+CAA+C;AAC/C,cAAc,wBAAwB,CAAC;AAEvC,+CAA+C;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAEtC,yDAAyD;AACzD,cAAc,uBAAuB,CAAC;AAEtC,wDAAwD;AACxD,cAAc,0BAA0B,CAAC;AAEzC,gEAAgE;AAChE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAE5C,gDAAgD;AAChD,cAAc,0BAA0B,CAAC"}
|
|
@@ -52,7 +52,7 @@ export type EntitySchemaOptions = {
|
|
|
52
52
|
* ```typescript
|
|
53
53
|
* // Using in a controller with validation
|
|
54
54
|
* @Post('/users')
|
|
55
|
-
* async createUser(
|
|
55
|
+
* async createUser(userData: unknown) {
|
|
56
56
|
* const userSchema = entity(User, {
|
|
57
57
|
* omit: ['id', 'createdAt', 'updatedAt']
|
|
58
58
|
* });
|
|
@@ -39,7 +39,7 @@ import { tableDefOf } from './tabledef.js';
|
|
|
39
39
|
* ```typescript
|
|
40
40
|
* // Using in a controller with validation
|
|
41
41
|
* @Post('/users')
|
|
42
|
-
* async createUser(
|
|
42
|
+
* async createUser(userData: unknown) {
|
|
43
43
|
* const userSchema = entity(User, {
|
|
44
44
|
* omit: ['id', 'createdAt', 'updatedAt']
|
|
45
45
|
* });
|