@ai0x0/utils 0.0.44 → 0.0.45
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/.agents/skills/ai0x0-utils/backend/SKILL.md +10 -8
- package/SKILL.md +10 -8
- package/es/__shims__/next-rest-framework.d.ts +5 -1
- package/es/backend/route-operation/delete-operation.d.ts +2 -1
- package/es/backend/route-operation/delete-operation.js +2 -0
- package/es/backend/route-operation/get-list-operation.d.ts +2 -1
- package/es/backend/route-operation/get-list-operation.js +2 -0
- package/es/backend/route-operation/get-operation.d.ts +2 -1
- package/es/backend/route-operation/get-operation.js +2 -0
- package/es/backend/route-operation/post-operation.d.ts +2 -1
- package/es/backend/route-operation/post-operation.js +2 -0
- package/es/backend/route-operation/put-operation.d.ts +2 -1
- package/es/backend/route-operation/put-operation.js +2 -0
- package/es/backend/sqlite/route-operation/delete-operation.d.ts +2 -1
- package/es/backend/sqlite/route-operation/delete-operation.js +2 -0
- package/es/backend/sqlite/route-operation/get-list-operation.d.ts +2 -1
- package/es/backend/sqlite/route-operation/get-list-operation.js +2 -0
- package/es/backend/sqlite/route-operation/get-operation.d.ts +2 -1
- package/es/backend/sqlite/route-operation/get-operation.js +2 -0
- package/es/backend/sqlite/route-operation/post-operation.d.ts +2 -1
- package/es/backend/sqlite/route-operation/post-operation.js +2 -0
- package/es/backend/sqlite/route-operation/put-operation.d.ts +2 -1
- package/es/backend/sqlite/route-operation/put-operation.js +2 -0
- package/lib/__shims__/next-rest-framework.d.ts +5 -1
- package/lib/backend/route-operation/delete-operation.d.ts +2 -1
- package/lib/backend/route-operation/delete-operation.js +2 -0
- package/lib/backend/route-operation/get-list-operation.d.ts +2 -1
- package/lib/backend/route-operation/get-list-operation.js +2 -0
- package/lib/backend/route-operation/get-operation.d.ts +2 -1
- package/lib/backend/route-operation/get-operation.js +2 -0
- package/lib/backend/route-operation/post-operation.d.ts +2 -1
- package/lib/backend/route-operation/post-operation.js +2 -0
- package/lib/backend/route-operation/put-operation.d.ts +2 -1
- package/lib/backend/route-operation/put-operation.js +2 -0
- package/lib/backend/sqlite/route-operation/delete-operation.d.ts +2 -1
- package/lib/backend/sqlite/route-operation/delete-operation.js +2 -0
- package/lib/backend/sqlite/route-operation/get-list-operation.d.ts +2 -1
- package/lib/backend/sqlite/route-operation/get-list-operation.js +2 -0
- package/lib/backend/sqlite/route-operation/get-operation.d.ts +2 -1
- package/lib/backend/sqlite/route-operation/get-operation.js +2 -0
- package/lib/backend/sqlite/route-operation/post-operation.d.ts +2 -1
- package/lib/backend/sqlite/route-operation/post-operation.js +2 -0
- package/lib/backend/sqlite/route-operation/put-operation.d.ts +2 -1
- package/lib/backend/sqlite/route-operation/put-operation.js +2 -0
- package/package.json +1 -1
|
@@ -87,17 +87,19 @@ export const getListOperation = createGetListOperation({ db, getSession });
|
|
|
87
87
|
|
|
88
88
|
## Factory Catalog
|
|
89
89
|
|
|
90
|
-
| Export | Purpose | Required options | Notable optional options
|
|
91
|
-
| ------------------- | -------------------------- | --------------------------- |
|
|
92
|
-
| `createTableSchema` | pg `Table` + 5 zod schemas | `name`, `columns` | `refineSchema`, `extraConfig`
|
|
93
|
-
| `getOperation` | GET one by filters | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `byCreator`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
94
|
-
| `getListOperation` | GET paginated list | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
95
|
-
| `postOperation` | POST create | `bodySchema` | `table`, `contentType`, `parseBody`, `outputBodySchema`, `setBody`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
96
|
-
| `putOperation` | PUT update | `bodySchema` | `table`, `outputBodySchema`, `setBody`, `byCreator`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
97
|
-
| `deleteOperation` | DELETE | — | `table`, `byCreator`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
90
|
+
| Export | Purpose | Required options | Notable optional options |
|
|
91
|
+
| ------------------- | -------------------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
92
|
+
| `createTableSchema` | pg `Table` + 5 zod schemas | `name`, `columns` | `refineSchema`, `extraConfig` |
|
|
93
|
+
| `getOperation` | GET one by filters | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `byCreator`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
94
|
+
| `getListOperation` | GET paginated list | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
95
|
+
| `postOperation` | POST create | `bodySchema` | `table`, `contentType`, `parseBody`, `outputBodySchema`, `setBody`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
96
|
+
| `putOperation` | PUT update | `bodySchema` | `table`, `outputBodySchema`, `setBody`, `byCreator`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
97
|
+
| `deleteOperation` | DELETE | — | `table`, `byCreator`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
98
98
|
|
|
99
99
|
`tags` can be passed manually to override the default OpenAPI tag inferred from `table`.
|
|
100
100
|
|
|
101
|
+
`summary` and `description` are forwarded into the OpenAPI operation object.
|
|
102
|
+
|
|
101
103
|
`postOperation` defaults to `contentType: "application/json"`. Pass `contentType: "multipart/form-data"` to read `await req.formData()` as body, or pass both a custom `contentType` and `parseBody(req)` for custom payload parsing.
|
|
102
104
|
|
|
103
105
|
`table` and factory-level `db` are optional for route operations. When `table` is omitted or `db` is not provided, the operation still parses input, applies `setParams` / `setBody`, session-derived fields, and `onSuccess`, but skips the built-in table action (`select` / `insert` / `update` / `delete`). Use this for custom endpoints that want the same OpenAPI and response wiring without a direct table operation.
|
package/SKILL.md
CHANGED
|
@@ -66,17 +66,19 @@ export const getListOperation = createGetListOperation({ db, getSession });
|
|
|
66
66
|
|
|
67
67
|
## Factory Catalog
|
|
68
68
|
|
|
69
|
-
| Export | Purpose | Required options | Notable optional options
|
|
70
|
-
| ------------------- | -------------------------- | --------------------------- |
|
|
71
|
-
| `createTableSchema` | pg `Table` + 5 zod schemas | `name`, `columns` | `refineSchema`, `extraConfig`
|
|
72
|
-
| `getOperation` | GET one by filters | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `byCreator`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
73
|
-
| `getListOperation` | GET paginated list | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
74
|
-
| `postOperation` | POST create | `bodySchema` | `table`, `contentType`, `parseBody`, `outputBodySchema`, `setBody`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
75
|
-
| `putOperation` | PUT update | `bodySchema` | `table`, `outputBodySchema`, `setBody`, `byCreator`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
76
|
-
| `deleteOperation` | DELETE | — | `table`, `byCreator`, `onSuccess`, `onError`, `summary`, `tags` |
|
|
69
|
+
| Export | Purpose | Required options | Notable optional options |
|
|
70
|
+
| ------------------- | -------------------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| `createTableSchema` | pg `Table` + 5 zod schemas | `name`, `columns` | `refineSchema`, `extraConfig` |
|
|
72
|
+
| `getOperation` | GET one by filters | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `byCreator`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
73
|
+
| `getListOperation` | GET paginated list | `bodySchema`, `querySchema` | `table`, `setParams`, `relations`, `jsonArrayFields`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
74
|
+
| `postOperation` | POST create | `bodySchema` | `table`, `contentType`, `parseBody`, `outputBodySchema`, `setBody`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
75
|
+
| `putOperation` | PUT update | `bodySchema` | `table`, `outputBodySchema`, `setBody`, `byCreator`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
76
|
+
| `deleteOperation` | DELETE | — | `table`, `byCreator`, `onSuccess`, `onError`, `summary`, `description`, `tags` |
|
|
77
77
|
|
|
78
78
|
`tags` can be passed manually to override the default OpenAPI tag inferred from `table`.
|
|
79
79
|
|
|
80
|
+
`summary` and `description` are forwarded into the OpenAPI operation object.
|
|
81
|
+
|
|
80
82
|
`postOperation` defaults to `contentType: "application/json"`. Pass `contentType: "multipart/form-data"` to read `await req.formData()` as body, or pass both a custom `contentType` and `parseBody(req)` for custom payload parsing.
|
|
81
83
|
|
|
82
84
|
`table` and factory-level `db` are optional for route operations. When `table` is omitted or `db` is not provided, the operation still parses input, applies `setParams` / `setBody`, session-derived fields, and `onSuccess`, but skips the built-in table action (`select` / `insert` / `update` / `delete`). Use this for custom endpoints that want the same OpenAPI and response wiring without a direct table operation.
|
|
@@ -22,7 +22,11 @@ declare module "next-rest-framework" {
|
|
|
22
22
|
|
|
23
23
|
export const routeOperation: <M extends string>(opts: {
|
|
24
24
|
method: M;
|
|
25
|
-
openApiOperation?: {
|
|
25
|
+
openApiOperation?: {
|
|
26
|
+
description?: string;
|
|
27
|
+
summary?: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
};
|
|
26
30
|
}) => RouteOperationBuilder<M>;
|
|
27
31
|
|
|
28
32
|
export const rpcOperation: () => {
|
|
@@ -4,6 +4,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
|
4
4
|
import { NextRequest } from "next/server";
|
|
5
5
|
export interface DeleteOperationOptions<TTable extends BaseTable> {
|
|
6
6
|
table?: TTable;
|
|
7
|
+
description?: string;
|
|
7
8
|
summary?: string;
|
|
8
9
|
tags?: string[];
|
|
9
10
|
onSuccess?: (payload: {
|
|
@@ -21,4 +22,4 @@ export declare const createDeleteOperation: ({ db, getSession, }: {
|
|
|
21
22
|
getSession(req: NextRequest): Promise<{
|
|
22
23
|
userId?: string;
|
|
23
24
|
} | undefined>;
|
|
24
|
-
}) => <TTable extends BaseTable>({ table, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
25
|
+
}) => <TTable extends BaseTable>({ table, description, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
@@ -12,6 +12,7 @@ export var createDeleteOperation = function createDeleteOperation(_ref) {
|
|
|
12
12
|
getSession = _ref.getSession;
|
|
13
13
|
return function (_ref2) {
|
|
14
14
|
var table = _ref2.table,
|
|
15
|
+
description = _ref2.description,
|
|
15
16
|
summary = _ref2.summary,
|
|
16
17
|
tags = _ref2.tags,
|
|
17
18
|
onSuccess = _ref2.onSuccess,
|
|
@@ -21,6 +22,7 @@ export var createDeleteOperation = function createDeleteOperation(_ref) {
|
|
|
21
22
|
return routeOperation({
|
|
22
23
|
method: "DELETE",
|
|
23
24
|
openApiOperation: {
|
|
25
|
+
description: description,
|
|
24
26
|
summary: summary,
|
|
25
27
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
26
28
|
}
|
|
@@ -10,6 +10,7 @@ export interface GetListOperationOptions<T extends ZodSchema, Q extends ZodSchem
|
|
|
10
10
|
relations?: GetListRelations;
|
|
11
11
|
setParams?(req: TypedNextRequest<"GET", "application/json", unknown, z.infer<Q>>): Promise<Record<string, unknown>>;
|
|
12
12
|
byCreator?: boolean;
|
|
13
|
+
description?: string;
|
|
13
14
|
summary?: string;
|
|
14
15
|
tags?: string[];
|
|
15
16
|
table?: TTable;
|
|
@@ -30,4 +31,4 @@ export declare const createGetListOperation: ({ db, getSession, }: {
|
|
|
30
31
|
getSession(req: NextRequest): Promise<{
|
|
31
32
|
userId?: string;
|
|
32
33
|
} | undefined>;
|
|
33
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
34
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -13,6 +13,7 @@ export var createGetListOperation = function createGetListOperation(_ref) {
|
|
|
13
13
|
var querySchema = _ref2.querySchema,
|
|
14
14
|
bodySchema = _ref2.bodySchema,
|
|
15
15
|
table = _ref2.table,
|
|
16
|
+
description = _ref2.description,
|
|
16
17
|
summary = _ref2.summary,
|
|
17
18
|
tags = _ref2.tags,
|
|
18
19
|
relations = _ref2.relations,
|
|
@@ -25,6 +26,7 @@ export var createGetListOperation = function createGetListOperation(_ref) {
|
|
|
25
26
|
return routeOperation({
|
|
26
27
|
method: "GET",
|
|
27
28
|
openApiOperation: {
|
|
29
|
+
description: description,
|
|
28
30
|
summary: summary,
|
|
29
31
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
30
32
|
}
|
|
@@ -14,6 +14,7 @@ export interface GetOperationOptions<T extends ZodSchema, Q extends ZodSchema, T
|
|
|
14
14
|
data: z.infer<T>;
|
|
15
15
|
}): Promise<z.infer<T>>;
|
|
16
16
|
onError?(error: Error): Promise<ReturnType<(typeof TypedNextResponse)["json"]> | undefined>;
|
|
17
|
+
description?: string;
|
|
17
18
|
summary?: string;
|
|
18
19
|
tags?: string[];
|
|
19
20
|
table?: TTable;
|
|
@@ -24,4 +25,4 @@ export declare const createGetOperation: ({ getSession, db, }: {
|
|
|
24
25
|
getSession(req: NextRequest): Promise<{
|
|
25
26
|
userId?: string;
|
|
26
27
|
} | undefined>;
|
|
27
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
28
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -12,6 +12,7 @@ export var createGetOperation = function createGetOperation(_ref) {
|
|
|
12
12
|
var querySchema = _ref2.querySchema,
|
|
13
13
|
bodySchema = _ref2.bodySchema,
|
|
14
14
|
table = _ref2.table,
|
|
15
|
+
description = _ref2.description,
|
|
15
16
|
summary = _ref2.summary,
|
|
16
17
|
tags = _ref2.tags,
|
|
17
18
|
relations = _ref2.relations,
|
|
@@ -24,6 +25,7 @@ export var createGetOperation = function createGetOperation(_ref) {
|
|
|
24
25
|
return routeOperation({
|
|
25
26
|
method: "GET",
|
|
26
27
|
openApiOperation: {
|
|
28
|
+
description: description,
|
|
27
29
|
summary: summary,
|
|
28
30
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
29
31
|
}
|
|
@@ -6,6 +6,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
|
6
6
|
export interface PostOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends PgTable> {
|
|
7
7
|
bodySchema: IB;
|
|
8
8
|
contentType?: string;
|
|
9
|
+
description?: string;
|
|
9
10
|
outputBodySchema?: OB;
|
|
10
11
|
parseBody?(req: NextRequest): Promise<Record<string, unknown>>;
|
|
11
12
|
setBody?(req: NextRequest): Promise<Partial<z.infer<IB>>>;
|
|
@@ -24,4 +25,4 @@ export declare const createPostOperation: ({ getSession, db, }: {
|
|
|
24
25
|
getSession(req: NextRequest): Promise<{
|
|
25
26
|
userId?: string;
|
|
26
27
|
} | undefined>;
|
|
27
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends PgTable<import("drizzle-orm/pg-core").TableConfig>>({ bodySchema, contentType, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
28
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends PgTable<import("drizzle-orm/pg-core").TableConfig>>({ bodySchema, contentType, description, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
@@ -57,6 +57,7 @@ export var createPostOperation = function createPostOperation(_ref2) {
|
|
|
57
57
|
var bodySchema = _ref3.bodySchema,
|
|
58
58
|
_ref3$contentType = _ref3.contentType,
|
|
59
59
|
contentType = _ref3$contentType === void 0 ? "application/json" : _ref3$contentType,
|
|
60
|
+
description = _ref3.description,
|
|
60
61
|
outputBodySchema = _ref3.outputBodySchema,
|
|
61
62
|
parseBody = _ref3.parseBody,
|
|
62
63
|
setBody = _ref3.setBody,
|
|
@@ -68,6 +69,7 @@ export var createPostOperation = function createPostOperation(_ref2) {
|
|
|
68
69
|
return routeOperation({
|
|
69
70
|
method: "POST",
|
|
70
71
|
openApiOperation: {
|
|
72
|
+
description: description,
|
|
71
73
|
summary: summary,
|
|
72
74
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
73
75
|
}
|
|
@@ -6,6 +6,7 @@ import { NextRequest } from "next/server";
|
|
|
6
6
|
import { BaseTable } from "../types.js";
|
|
7
7
|
export interface PutOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends PgTable> {
|
|
8
8
|
bodySchema: IB;
|
|
9
|
+
description?: string;
|
|
9
10
|
outputBodySchema?: OB;
|
|
10
11
|
table?: TTable;
|
|
11
12
|
summary?: string;
|
|
@@ -23,4 +24,4 @@ export declare const createPutOperation: ({ getSession, db, }: {
|
|
|
23
24
|
userId?: string;
|
|
24
25
|
} | undefined>;
|
|
25
26
|
db?: NodePgDatabase<Record<string, unknown>> | undefined;
|
|
26
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
27
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, description, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
@@ -17,6 +17,7 @@ export var createPutOperation = function createPutOperation(_ref) {
|
|
|
17
17
|
db = _ref.db;
|
|
18
18
|
return function (_ref2) {
|
|
19
19
|
var bodySchema = _ref2.bodySchema,
|
|
20
|
+
description = _ref2.description,
|
|
20
21
|
outputBodySchema = _ref2.outputBodySchema,
|
|
21
22
|
table = _ref2.table,
|
|
22
23
|
summary = _ref2.summary,
|
|
@@ -29,6 +30,7 @@ export var createPutOperation = function createPutOperation(_ref) {
|
|
|
29
30
|
return routeOperation({
|
|
30
31
|
method: "PUT",
|
|
31
32
|
openApiOperation: {
|
|
33
|
+
description: description,
|
|
32
34
|
summary: summary,
|
|
33
35
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
34
36
|
}
|
|
@@ -3,6 +3,7 @@ import { BaseTable } from "../types.js";
|
|
|
3
3
|
import { NextRequest } from "next/server";
|
|
4
4
|
export interface DeleteOperationOptions<TTable extends BaseTable> {
|
|
5
5
|
table?: TTable;
|
|
6
|
+
description?: string;
|
|
6
7
|
summary?: string;
|
|
7
8
|
tags?: string[];
|
|
8
9
|
onSuccess?: (_payload: {
|
|
@@ -20,4 +21,4 @@ export declare const createDeleteOperation: ({ db, getSession, }: {
|
|
|
20
21
|
getSession: (_req: NextRequest) => Promise<{
|
|
21
22
|
userId?: string;
|
|
22
23
|
} | undefined>;
|
|
23
|
-
}) => <TTable extends BaseTable>({ table, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
24
|
+
}) => <TTable extends BaseTable>({ table, description, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
@@ -12,6 +12,7 @@ export var createDeleteOperation = function createDeleteOperation(_ref) {
|
|
|
12
12
|
getSession = _ref.getSession;
|
|
13
13
|
return function (_ref2) {
|
|
14
14
|
var table = _ref2.table,
|
|
15
|
+
description = _ref2.description,
|
|
15
16
|
summary = _ref2.summary,
|
|
16
17
|
tags = _ref2.tags,
|
|
17
18
|
onSuccess = _ref2.onSuccess,
|
|
@@ -21,6 +22,7 @@ export var createDeleteOperation = function createDeleteOperation(_ref) {
|
|
|
21
22
|
return routeOperation({
|
|
22
23
|
method: "DELETE",
|
|
23
24
|
openApiOperation: {
|
|
25
|
+
description: description,
|
|
24
26
|
summary: summary,
|
|
25
27
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
26
28
|
}
|
|
@@ -9,6 +9,7 @@ export interface GetListOperationOptions<T extends ZodSchema, Q extends ZodSchem
|
|
|
9
9
|
relations?: GetListRelations;
|
|
10
10
|
setParams?: (_req: TypedNextRequest<"GET", "application/json", unknown, z.infer<Q>>) => Promise<Record<string, unknown>>;
|
|
11
11
|
byCreator?: boolean;
|
|
12
|
+
description?: string;
|
|
12
13
|
summary?: string;
|
|
13
14
|
tags?: string[];
|
|
14
15
|
table?: TTable;
|
|
@@ -29,4 +30,4 @@ export declare const createGetListOperation: ({ db, getSession, }: {
|
|
|
29
30
|
getSession: (_req: NextRequest) => Promise<{
|
|
30
31
|
userId?: string;
|
|
31
32
|
} | undefined>;
|
|
32
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
33
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -13,6 +13,7 @@ export var createGetListOperation = function createGetListOperation(_ref) {
|
|
|
13
13
|
var querySchema = _ref2.querySchema,
|
|
14
14
|
bodySchema = _ref2.bodySchema,
|
|
15
15
|
table = _ref2.table,
|
|
16
|
+
description = _ref2.description,
|
|
16
17
|
summary = _ref2.summary,
|
|
17
18
|
tags = _ref2.tags,
|
|
18
19
|
relations = _ref2.relations,
|
|
@@ -25,6 +26,7 @@ export var createGetListOperation = function createGetListOperation(_ref) {
|
|
|
25
26
|
return routeOperation({
|
|
26
27
|
method: "GET",
|
|
27
28
|
openApiOperation: {
|
|
29
|
+
description: description,
|
|
28
30
|
summary: summary,
|
|
29
31
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
30
32
|
}
|
|
@@ -13,6 +13,7 @@ export interface GetOperationOptions<T extends ZodSchema, Q extends ZodSchema, T
|
|
|
13
13
|
data: z.infer<T>;
|
|
14
14
|
}) => Promise<z.infer<T>>;
|
|
15
15
|
onError?: (_error: Error) => Promise<ReturnType<(typeof TypedNextResponse)["json"]> | undefined>;
|
|
16
|
+
description?: string;
|
|
16
17
|
summary?: string;
|
|
17
18
|
tags?: string[];
|
|
18
19
|
table?: TTable;
|
|
@@ -23,4 +24,4 @@ export declare const createGetOperation: ({ getSession, db, }: {
|
|
|
23
24
|
getSession: (_req: NextRequest) => Promise<{
|
|
24
25
|
userId?: string;
|
|
25
26
|
} | undefined>;
|
|
26
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
27
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -12,6 +12,7 @@ export var createGetOperation = function createGetOperation(_ref) {
|
|
|
12
12
|
var querySchema = _ref2.querySchema,
|
|
13
13
|
bodySchema = _ref2.bodySchema,
|
|
14
14
|
table = _ref2.table,
|
|
15
|
+
description = _ref2.description,
|
|
15
16
|
summary = _ref2.summary,
|
|
16
17
|
tags = _ref2.tags,
|
|
17
18
|
relations = _ref2.relations,
|
|
@@ -24,6 +25,7 @@ export var createGetOperation = function createGetOperation(_ref) {
|
|
|
24
25
|
return routeOperation({
|
|
25
26
|
method: "GET",
|
|
26
27
|
openApiOperation: {
|
|
28
|
+
description: description,
|
|
27
29
|
summary: summary,
|
|
28
30
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
29
31
|
}
|
|
@@ -5,6 +5,7 @@ import { TypedNextResponse } from "next-rest-framework";
|
|
|
5
5
|
export interface PostOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends SQLiteTable> {
|
|
6
6
|
bodySchema: IB;
|
|
7
7
|
contentType?: string;
|
|
8
|
+
description?: string;
|
|
8
9
|
outputBodySchema?: OB;
|
|
9
10
|
parseBody?: (_req: NextRequest) => Promise<Record<string, unknown>>;
|
|
10
11
|
setBody?: (_req: NextRequest) => Promise<Partial<z.infer<IB>>>;
|
|
@@ -23,4 +24,4 @@ export declare const createPostOperation: ({ getSession, db, }: {
|
|
|
23
24
|
getSession: (_req: NextRequest) => Promise<{
|
|
24
25
|
userId?: string;
|
|
25
26
|
} | undefined>;
|
|
26
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends SQLiteTable<import("drizzle-orm/sqlite-core").TableConfig>>({ bodySchema, contentType, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
27
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends SQLiteTable<import("drizzle-orm/sqlite-core").TableConfig>>({ bodySchema, contentType, description, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
@@ -57,6 +57,7 @@ export var createPostOperation = function createPostOperation(_ref2) {
|
|
|
57
57
|
var bodySchema = _ref3.bodySchema,
|
|
58
58
|
_ref3$contentType = _ref3.contentType,
|
|
59
59
|
contentType = _ref3$contentType === void 0 ? "application/json" : _ref3$contentType,
|
|
60
|
+
description = _ref3.description,
|
|
60
61
|
outputBodySchema = _ref3.outputBodySchema,
|
|
61
62
|
parseBody = _ref3.parseBody,
|
|
62
63
|
setBody = _ref3.setBody,
|
|
@@ -68,6 +69,7 @@ export var createPostOperation = function createPostOperation(_ref2) {
|
|
|
68
69
|
return routeOperation({
|
|
69
70
|
method: "POST",
|
|
70
71
|
openApiOperation: {
|
|
72
|
+
description: description,
|
|
71
73
|
summary: summary,
|
|
72
74
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
73
75
|
}
|
|
@@ -5,6 +5,7 @@ import { NextRequest } from "next/server";
|
|
|
5
5
|
import { BaseTable } from "../types.js";
|
|
6
6
|
export interface PutOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends SQLiteTable> {
|
|
7
7
|
bodySchema: IB;
|
|
8
|
+
description?: string;
|
|
8
9
|
outputBodySchema?: OB;
|
|
9
10
|
table?: TTable;
|
|
10
11
|
summary?: string;
|
|
@@ -22,4 +23,4 @@ export declare const createPutOperation: ({ getSession, db, }: {
|
|
|
22
23
|
userId?: string;
|
|
23
24
|
} | undefined>;
|
|
24
25
|
db?: any;
|
|
25
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
26
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, description, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
@@ -17,6 +17,7 @@ export var createPutOperation = function createPutOperation(_ref) {
|
|
|
17
17
|
db = _ref.db;
|
|
18
18
|
return function (_ref2) {
|
|
19
19
|
var bodySchema = _ref2.bodySchema,
|
|
20
|
+
description = _ref2.description,
|
|
20
21
|
outputBodySchema = _ref2.outputBodySchema,
|
|
21
22
|
table = _ref2.table,
|
|
22
23
|
summary = _ref2.summary,
|
|
@@ -29,6 +30,7 @@ export var createPutOperation = function createPutOperation(_ref) {
|
|
|
29
30
|
return routeOperation({
|
|
30
31
|
method: "PUT",
|
|
31
32
|
openApiOperation: {
|
|
33
|
+
description: description,
|
|
32
34
|
summary: summary,
|
|
33
35
|
tags: tags !== null && tags !== void 0 ? tags : table ? [getTableName(table)] : []
|
|
34
36
|
}
|
|
@@ -22,7 +22,11 @@ declare module "next-rest-framework" {
|
|
|
22
22
|
|
|
23
23
|
export const routeOperation: <M extends string>(opts: {
|
|
24
24
|
method: M;
|
|
25
|
-
openApiOperation?: {
|
|
25
|
+
openApiOperation?: {
|
|
26
|
+
description?: string;
|
|
27
|
+
summary?: string;
|
|
28
|
+
tags?: string[];
|
|
29
|
+
};
|
|
26
30
|
}) => RouteOperationBuilder<M>;
|
|
27
31
|
|
|
28
32
|
export const rpcOperation: () => {
|
|
@@ -4,6 +4,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
|
4
4
|
import { NextRequest } from "next/server";
|
|
5
5
|
export interface DeleteOperationOptions<TTable extends BaseTable> {
|
|
6
6
|
table?: TTable;
|
|
7
|
+
description?: string;
|
|
7
8
|
summary?: string;
|
|
8
9
|
tags?: string[];
|
|
9
10
|
onSuccess?: (payload: {
|
|
@@ -21,4 +22,4 @@ export declare const createDeleteOperation: ({ db, getSession, }: {
|
|
|
21
22
|
getSession(req: NextRequest): Promise<{
|
|
22
23
|
userId?: string;
|
|
23
24
|
} | undefined>;
|
|
24
|
-
}) => <TTable extends BaseTable>({ table, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
25
|
+
}) => <TTable extends BaseTable>({ table, description, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
@@ -42,6 +42,7 @@ var createDeleteOperation = ({
|
|
|
42
42
|
getSession
|
|
43
43
|
}) => ({
|
|
44
44
|
table,
|
|
45
|
+
description,
|
|
45
46
|
summary,
|
|
46
47
|
tags,
|
|
47
48
|
onSuccess,
|
|
@@ -50,6 +51,7 @@ var createDeleteOperation = ({
|
|
|
50
51
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
51
52
|
method: "DELETE",
|
|
52
53
|
openApiOperation: {
|
|
54
|
+
description,
|
|
53
55
|
summary,
|
|
54
56
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
55
57
|
}
|
|
@@ -10,6 +10,7 @@ export interface GetListOperationOptions<T extends ZodSchema, Q extends ZodSchem
|
|
|
10
10
|
relations?: GetListRelations;
|
|
11
11
|
setParams?(req: TypedNextRequest<"GET", "application/json", unknown, z.infer<Q>>): Promise<Record<string, unknown>>;
|
|
12
12
|
byCreator?: boolean;
|
|
13
|
+
description?: string;
|
|
13
14
|
summary?: string;
|
|
14
15
|
tags?: string[];
|
|
15
16
|
table?: TTable;
|
|
@@ -30,4 +31,4 @@ export declare const createGetListOperation: ({ db, getSession, }: {
|
|
|
30
31
|
getSession(req: NextRequest): Promise<{
|
|
31
32
|
userId?: string;
|
|
32
33
|
} | undefined>;
|
|
33
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
34
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -43,6 +43,7 @@ var createGetListOperation = ({
|
|
|
43
43
|
querySchema,
|
|
44
44
|
bodySchema,
|
|
45
45
|
table,
|
|
46
|
+
description,
|
|
46
47
|
summary,
|
|
47
48
|
tags,
|
|
48
49
|
relations,
|
|
@@ -54,6 +55,7 @@ var createGetListOperation = ({
|
|
|
54
55
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
55
56
|
method: "GET",
|
|
56
57
|
openApiOperation: {
|
|
58
|
+
description,
|
|
57
59
|
summary,
|
|
58
60
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
59
61
|
}
|
|
@@ -14,6 +14,7 @@ export interface GetOperationOptions<T extends ZodSchema, Q extends ZodSchema, T
|
|
|
14
14
|
data: z.infer<T>;
|
|
15
15
|
}): Promise<z.infer<T>>;
|
|
16
16
|
onError?(error: Error): Promise<ReturnType<(typeof TypedNextResponse)["json"]> | undefined>;
|
|
17
|
+
description?: string;
|
|
17
18
|
summary?: string;
|
|
18
19
|
tags?: string[];
|
|
19
20
|
table?: TTable;
|
|
@@ -24,4 +25,4 @@ export declare const createGetOperation: ({ getSession, db, }: {
|
|
|
24
25
|
getSession(req: NextRequest): Promise<{
|
|
25
26
|
userId?: string;
|
|
26
27
|
} | undefined>;
|
|
27
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
28
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -42,6 +42,7 @@ var createGetOperation = ({
|
|
|
42
42
|
querySchema,
|
|
43
43
|
bodySchema,
|
|
44
44
|
table,
|
|
45
|
+
description,
|
|
45
46
|
summary,
|
|
46
47
|
tags,
|
|
47
48
|
relations,
|
|
@@ -53,6 +54,7 @@ var createGetOperation = ({
|
|
|
53
54
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
54
55
|
method: "GET",
|
|
55
56
|
openApiOperation: {
|
|
57
|
+
description,
|
|
56
58
|
summary,
|
|
57
59
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
58
60
|
}
|
|
@@ -6,6 +6,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
|
6
6
|
export interface PostOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends PgTable> {
|
|
7
7
|
bodySchema: IB;
|
|
8
8
|
contentType?: string;
|
|
9
|
+
description?: string;
|
|
9
10
|
outputBodySchema?: OB;
|
|
10
11
|
parseBody?(req: NextRequest): Promise<Record<string, unknown>>;
|
|
11
12
|
setBody?(req: NextRequest): Promise<Partial<z.infer<IB>>>;
|
|
@@ -24,4 +25,4 @@ export declare const createPostOperation: ({ getSession, db, }: {
|
|
|
24
25
|
getSession(req: NextRequest): Promise<{
|
|
25
26
|
userId?: string;
|
|
26
27
|
} | undefined>;
|
|
27
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends PgTable<import("drizzle-orm/pg-core").TableConfig>>({ bodySchema, contentType, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
28
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends PgTable<import("drizzle-orm/pg-core").TableConfig>>({ bodySchema, contentType, description, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
@@ -54,6 +54,7 @@ var createPostOperation = ({
|
|
|
54
54
|
}) => ({
|
|
55
55
|
bodySchema,
|
|
56
56
|
contentType = "application/json",
|
|
57
|
+
description,
|
|
57
58
|
outputBodySchema,
|
|
58
59
|
parseBody,
|
|
59
60
|
setBody,
|
|
@@ -65,6 +66,7 @@ var createPostOperation = ({
|
|
|
65
66
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
66
67
|
method: "POST",
|
|
67
68
|
openApiOperation: {
|
|
69
|
+
description,
|
|
68
70
|
summary,
|
|
69
71
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
70
72
|
}
|
|
@@ -6,6 +6,7 @@ import { NextRequest } from "next/server";
|
|
|
6
6
|
import { BaseTable } from "../types.js";
|
|
7
7
|
export interface PutOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends PgTable> {
|
|
8
8
|
bodySchema: IB;
|
|
9
|
+
description?: string;
|
|
9
10
|
outputBodySchema?: OB;
|
|
10
11
|
table?: TTable;
|
|
11
12
|
summary?: string;
|
|
@@ -23,4 +24,4 @@ export declare const createPutOperation: ({ getSession, db, }: {
|
|
|
23
24
|
userId?: string;
|
|
24
25
|
} | undefined>;
|
|
25
26
|
db?: NodePgDatabase<Record<string, unknown>> | undefined;
|
|
26
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
27
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, description, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
@@ -42,6 +42,7 @@ var createPutOperation = ({
|
|
|
42
42
|
db
|
|
43
43
|
}) => ({
|
|
44
44
|
bodySchema,
|
|
45
|
+
description,
|
|
45
46
|
outputBodySchema,
|
|
46
47
|
table,
|
|
47
48
|
summary,
|
|
@@ -53,6 +54,7 @@ var createPutOperation = ({
|
|
|
53
54
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
54
55
|
method: "PUT",
|
|
55
56
|
openApiOperation: {
|
|
57
|
+
description,
|
|
56
58
|
summary,
|
|
57
59
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
58
60
|
}
|
|
@@ -3,6 +3,7 @@ import { BaseTable } from "../types.js";
|
|
|
3
3
|
import { NextRequest } from "next/server";
|
|
4
4
|
export interface DeleteOperationOptions<TTable extends BaseTable> {
|
|
5
5
|
table?: TTable;
|
|
6
|
+
description?: string;
|
|
6
7
|
summary?: string;
|
|
7
8
|
tags?: string[];
|
|
8
9
|
onSuccess?: (_payload: {
|
|
@@ -20,4 +21,4 @@ export declare const createDeleteOperation: ({ db, getSession, }: {
|
|
|
20
21
|
getSession: (_req: NextRequest) => Promise<{
|
|
21
22
|
userId?: string;
|
|
22
23
|
} | undefined>;
|
|
23
|
-
}) => <TTable extends BaseTable>({ table, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
24
|
+
}) => <TTable extends BaseTable>({ table, description, summary, tags, onSuccess, onError, byCreator, }: DeleteOperationOptions<TTable>) => import("next-rest-framework").RouteOperationDefinition<"DELETE">;
|
|
@@ -42,6 +42,7 @@ var createDeleteOperation = ({
|
|
|
42
42
|
getSession
|
|
43
43
|
}) => ({
|
|
44
44
|
table,
|
|
45
|
+
description,
|
|
45
46
|
summary,
|
|
46
47
|
tags,
|
|
47
48
|
onSuccess,
|
|
@@ -50,6 +51,7 @@ var createDeleteOperation = ({
|
|
|
50
51
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
51
52
|
method: "DELETE",
|
|
52
53
|
openApiOperation: {
|
|
54
|
+
description,
|
|
53
55
|
summary,
|
|
54
56
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
55
57
|
}
|
|
@@ -9,6 +9,7 @@ export interface GetListOperationOptions<T extends ZodSchema, Q extends ZodSchem
|
|
|
9
9
|
relations?: GetListRelations;
|
|
10
10
|
setParams?: (_req: TypedNextRequest<"GET", "application/json", unknown, z.infer<Q>>) => Promise<Record<string, unknown>>;
|
|
11
11
|
byCreator?: boolean;
|
|
12
|
+
description?: string;
|
|
12
13
|
summary?: string;
|
|
13
14
|
tags?: string[];
|
|
14
15
|
table?: TTable;
|
|
@@ -29,4 +30,4 @@ export declare const createGetListOperation: ({ db, getSession, }: {
|
|
|
29
30
|
getSession: (_req: NextRequest) => Promise<{
|
|
30
31
|
userId?: string;
|
|
31
32
|
} | undefined>;
|
|
32
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
33
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, jsonArrayFields, setParams, onSuccess, onError, byCreator, }: GetListOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -43,6 +43,7 @@ var createGetListOperation = ({
|
|
|
43
43
|
querySchema,
|
|
44
44
|
bodySchema,
|
|
45
45
|
table,
|
|
46
|
+
description,
|
|
46
47
|
summary,
|
|
47
48
|
tags,
|
|
48
49
|
relations,
|
|
@@ -54,6 +55,7 @@ var createGetListOperation = ({
|
|
|
54
55
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
55
56
|
method: "GET",
|
|
56
57
|
openApiOperation: {
|
|
58
|
+
description,
|
|
57
59
|
summary,
|
|
58
60
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
59
61
|
}
|
|
@@ -13,6 +13,7 @@ export interface GetOperationOptions<T extends ZodSchema, Q extends ZodSchema, T
|
|
|
13
13
|
data: z.infer<T>;
|
|
14
14
|
}) => Promise<z.infer<T>>;
|
|
15
15
|
onError?: (_error: Error) => Promise<ReturnType<(typeof TypedNextResponse)["json"]> | undefined>;
|
|
16
|
+
description?: string;
|
|
16
17
|
summary?: string;
|
|
17
18
|
tags?: string[];
|
|
18
19
|
table?: TTable;
|
|
@@ -23,4 +24,4 @@ export declare const createGetOperation: ({ getSession, db, }: {
|
|
|
23
24
|
getSession: (_req: NextRequest) => Promise<{
|
|
24
25
|
userId?: string;
|
|
25
26
|
} | undefined>;
|
|
26
|
-
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
27
|
+
}) => <T extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Q extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ querySchema, bodySchema, table, description, summary, tags, relations, setParams, jsonArrayFields, onSuccess, onError, byCreator, }: GetOperationOptions<T, Q, TTable>) => import("next-rest-framework").RouteOperationDefinition<"GET">;
|
|
@@ -42,6 +42,7 @@ var createGetOperation = ({
|
|
|
42
42
|
querySchema,
|
|
43
43
|
bodySchema,
|
|
44
44
|
table,
|
|
45
|
+
description,
|
|
45
46
|
summary,
|
|
46
47
|
tags,
|
|
47
48
|
relations,
|
|
@@ -53,6 +54,7 @@ var createGetOperation = ({
|
|
|
53
54
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
54
55
|
method: "GET",
|
|
55
56
|
openApiOperation: {
|
|
57
|
+
description,
|
|
56
58
|
summary,
|
|
57
59
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
58
60
|
}
|
|
@@ -5,6 +5,7 @@ import { TypedNextResponse } from "next-rest-framework";
|
|
|
5
5
|
export interface PostOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends SQLiteTable> {
|
|
6
6
|
bodySchema: IB;
|
|
7
7
|
contentType?: string;
|
|
8
|
+
description?: string;
|
|
8
9
|
outputBodySchema?: OB;
|
|
9
10
|
parseBody?: (_req: NextRequest) => Promise<Record<string, unknown>>;
|
|
10
11
|
setBody?: (_req: NextRequest) => Promise<Partial<z.infer<IB>>>;
|
|
@@ -23,4 +24,4 @@ export declare const createPostOperation: ({ getSession, db, }: {
|
|
|
23
24
|
getSession: (_req: NextRequest) => Promise<{
|
|
24
25
|
userId?: string;
|
|
25
26
|
} | undefined>;
|
|
26
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends SQLiteTable<import("drizzle-orm/sqlite-core").TableConfig>>({ bodySchema, contentType, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
27
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends SQLiteTable<import("drizzle-orm/sqlite-core").TableConfig>>({ bodySchema, contentType, description, outputBodySchema, parseBody, setBody, summary, tags, table, onSuccess, onError, }: PostOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"POST">;
|
|
@@ -54,6 +54,7 @@ var createPostOperation = ({
|
|
|
54
54
|
}) => ({
|
|
55
55
|
bodySchema,
|
|
56
56
|
contentType = "application/json",
|
|
57
|
+
description,
|
|
57
58
|
outputBodySchema,
|
|
58
59
|
parseBody,
|
|
59
60
|
setBody,
|
|
@@ -65,6 +66,7 @@ var createPostOperation = ({
|
|
|
65
66
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
66
67
|
method: "POST",
|
|
67
68
|
openApiOperation: {
|
|
69
|
+
description,
|
|
68
70
|
summary,
|
|
69
71
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
70
72
|
}
|
|
@@ -5,6 +5,7 @@ import { NextRequest } from "next/server";
|
|
|
5
5
|
import { BaseTable } from "../types.js";
|
|
6
6
|
export interface PutOperationOptions<IB extends ZodSchema, OB extends ZodSchema, TTable extends SQLiteTable> {
|
|
7
7
|
bodySchema: IB;
|
|
8
|
+
description?: string;
|
|
8
9
|
outputBodySchema?: OB;
|
|
9
10
|
table?: TTable;
|
|
10
11
|
summary?: string;
|
|
@@ -22,4 +23,4 @@ export declare const createPutOperation: ({ getSession, db, }: {
|
|
|
22
23
|
userId?: string;
|
|
23
24
|
} | undefined>;
|
|
24
25
|
db?: any;
|
|
25
|
-
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
26
|
+
}) => <IB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, OB extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, TTable extends BaseTable>({ bodySchema, description, outputBodySchema, table, summary, tags, setBody, onSuccess, byCreator, onError, }: PutOperationOptions<IB, OB, TTable>) => import("next-rest-framework").RouteOperationDefinition<"PUT">;
|
|
@@ -42,6 +42,7 @@ var createPutOperation = ({
|
|
|
42
42
|
db
|
|
43
43
|
}) => ({
|
|
44
44
|
bodySchema,
|
|
45
|
+
description,
|
|
45
46
|
outputBodySchema,
|
|
46
47
|
table,
|
|
47
48
|
summary,
|
|
@@ -53,6 +54,7 @@ var createPutOperation = ({
|
|
|
53
54
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
54
55
|
method: "PUT",
|
|
55
56
|
openApiOperation: {
|
|
57
|
+
description,
|
|
56
58
|
summary,
|
|
57
59
|
tags: tags ?? (table ? [(0, import_get_table_name.default)(table)] : [])
|
|
58
60
|
}
|