@ai0x0/utils 0.0.3 → 0.0.5
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/es/backend/actions/create-delete-action.d.ts +6 -0
- package/es/backend/actions/{delete-action-fn.js → create-delete-action.js} +3 -8
- package/es/backend/actions/{get-list-action-fn.d.ts → create-get-action.d.ts} +4 -5
- package/es/backend/actions/{get-action-fn.js → create-get-action.js} +4 -12
- package/es/backend/actions/create-get-list-action.d.ts +13 -0
- package/es/backend/actions/{get-list-action-fn.js → create-get-list-action.js} +3 -12
- package/es/backend/actions/create-post-action.d.ts +8 -0
- package/es/backend/actions/{post-action-fn.js → create-post-action.js} +4 -14
- package/es/backend/actions/create-put-action.d.ts +8 -0
- package/es/backend/actions/{put-action-fn.js → create-put-action.js} +4 -12
- package/es/backend/actions/get-list-data.d.ts +16 -1
- package/es/backend/actions/index.d.ts +5 -5
- package/es/backend/actions/index.js +5 -5
- package/es/backend/route-operation/delete-operation.d.ts +3 -2
- package/es/backend/route-operation/delete-operation.js +13 -11
- package/es/backend/route-operation/get-list-operation.d.ts +3 -3
- package/es/backend/route-operation/get-list-operation.js +5 -6
- package/es/backend/route-operation/get-operation.d.ts +4 -3
- package/es/backend/route-operation/get-operation.js +20 -4
- package/es/backend/route-operation/post-operation.d.ts +3 -2
- package/es/backend/route-operation/post-operation.js +18 -8
- package/es/backend/route-operation/put-operation.d.ts +4 -2
- package/es/backend/route-operation/put-operation.js +20 -12
- package/es/backend/schemas/index.d.ts +10 -2
- package/es/backend/schemas/index.js +1 -1
- package/es/backend/types.d.ts +5 -1
- package/lib/backend/actions/create-delete-action.d.ts +6 -0
- package/lib/backend/actions/{delete-action-fn.js → create-delete-action.js} +9 -14
- package/lib/backend/actions/{get-list-action-fn.d.ts → create-get-action.d.ts} +4 -5
- package/lib/backend/actions/{get-action-fn.js → create-get-action.js} +10 -20
- package/lib/backend/actions/create-get-list-action.d.ts +13 -0
- package/lib/backend/actions/{get-list-action-fn.js → create-get-list-action.js} +9 -20
- package/lib/backend/actions/create-post-action.d.ts +8 -0
- package/lib/backend/actions/{post-action-fn.js → create-post-action.js} +9 -21
- package/lib/backend/actions/create-put-action.d.ts +8 -0
- package/lib/backend/actions/{put-action-fn.js → create-put-action.js} +9 -14
- package/lib/backend/actions/get-list-data.d.ts +16 -1
- package/lib/backend/actions/index.d.ts +5 -5
- package/lib/backend/actions/index.js +17 -17
- package/lib/backend/route-operation/delete-operation.d.ts +3 -2
- package/lib/backend/route-operation/delete-operation.js +8 -2
- package/lib/backend/route-operation/get-list-operation.d.ts +3 -3
- package/lib/backend/route-operation/get-list-operation.js +4 -5
- package/lib/backend/route-operation/get-operation.d.ts +4 -3
- package/lib/backend/route-operation/get-operation.js +6 -3
- package/lib/backend/route-operation/post-operation.d.ts +3 -2
- package/lib/backend/route-operation/post-operation.js +11 -2
- package/lib/backend/route-operation/put-operation.d.ts +4 -2
- package/lib/backend/route-operation/put-operation.js +19 -12
- package/lib/backend/schemas/index.d.ts +10 -2
- package/lib/backend/schemas/index.js +2 -0
- package/lib/backend/types.d.ts +5 -1
- package/package.json +3 -3
- package/es/backend/actions/delete-action-fn.d.ts +0 -6
- package/es/backend/actions/get-action-fn.d.ts +0 -11
- package/es/backend/actions/post-action-fn.d.ts +0 -12
- package/es/backend/actions/put-action-fn.d.ts +0 -8
- package/lib/backend/actions/delete-action-fn.d.ts +0 -6
- package/lib/backend/actions/get-action-fn.d.ts +0 -11
- package/lib/backend/actions/post-action-fn.d.ts +0 -12
- package/lib/backend/actions/put-action-fn.d.ts +0 -8
|
@@ -47,7 +47,7 @@ var createGetListOperation = ({
|
|
|
47
47
|
relations,
|
|
48
48
|
jsonArrayFields,
|
|
49
49
|
setParams,
|
|
50
|
-
|
|
50
|
+
onSuccess,
|
|
51
51
|
byCreator = true
|
|
52
52
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
53
53
|
method: "GET",
|
|
@@ -69,11 +69,10 @@ var createGetListOperation = ({
|
|
|
69
69
|
const { userId } = await getSession(req) || {};
|
|
70
70
|
params.creatorId = userId;
|
|
71
71
|
}
|
|
72
|
-
let result = await (0, import_actions.
|
|
72
|
+
let result = await (0, import_actions.createGetListAction)({
|
|
73
73
|
bodySchema,
|
|
74
74
|
db,
|
|
75
75
|
jsonArrayFields,
|
|
76
|
-
querySchema,
|
|
77
76
|
relations,
|
|
78
77
|
table
|
|
79
78
|
})(
|
|
@@ -82,8 +81,8 @@ var createGetListOperation = ({
|
|
|
82
81
|
params
|
|
83
82
|
)
|
|
84
83
|
);
|
|
85
|
-
if (
|
|
86
|
-
result = await
|
|
84
|
+
if (onSuccess) {
|
|
85
|
+
result = await onSuccess(result);
|
|
87
86
|
}
|
|
88
87
|
return import_next_rest_framework.TypedNextResponse.json(result, { status: 200 });
|
|
89
88
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZodSchema } from "zod";
|
|
1
|
+
import { z, ZodSchema } from "zod";
|
|
2
2
|
import { NextRequest } from "next/server";
|
|
3
3
|
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
4
4
|
import { BaseTable, GetListRelations } from "../types";
|
|
@@ -8,13 +8,14 @@ export interface GetOperationOptions<T extends ZodSchema, Q extends ZodSchema, T
|
|
|
8
8
|
querySchema: Q;
|
|
9
9
|
relations?: GetListRelations;
|
|
10
10
|
setParams?: (req: NextRequest) => Promise<Record<string, any>>;
|
|
11
|
+
onSuccess?: (data: z.infer<T>) => Promise<z.infer<T>>;
|
|
11
12
|
summary?: string;
|
|
12
13
|
table: TTable;
|
|
13
14
|
byCreator?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare const createGetOperation:
|
|
16
|
+
export declare const createGetOperation: ({ getSession, db, }: {
|
|
16
17
|
db: NodePgDatabase<any>;
|
|
17
18
|
getSession: (req: NextRequest) => Promise<{
|
|
18
19
|
userId?: string;
|
|
19
20
|
} | undefined>;
|
|
20
|
-
}) => ({ querySchema, bodySchema, table, summary, relations, setParams, jsonArrayFields, byCreator, }: GetOperationOptions<T, Q, TTable>) => any;
|
|
21
|
+
}) => <T extends z.ZodType<any, z.ZodTypeDef, any>, Q extends z.ZodType<any, z.ZodTypeDef, any>, TTable extends BaseTable>({ querySchema, bodySchema, table, summary, relations, setParams, jsonArrayFields, onSuccess, byCreator, }: GetOperationOptions<T, Q, TTable>) => any;
|
|
@@ -46,6 +46,7 @@ var createGetOperation = ({
|
|
|
46
46
|
relations,
|
|
47
47
|
setParams,
|
|
48
48
|
jsonArrayFields,
|
|
49
|
+
onSuccess,
|
|
49
50
|
byCreator = true
|
|
50
51
|
}) => (0, import_next_rest_framework.routeOperation)({
|
|
51
52
|
method: "GET",
|
|
@@ -67,11 +68,10 @@ var createGetOperation = ({
|
|
|
67
68
|
const { userId } = await getSession(req) || {};
|
|
68
69
|
params.creatorId = userId;
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
+
let result = await (0, import_actions.createGetAction)({
|
|
71
72
|
bodySchema,
|
|
72
73
|
db,
|
|
73
74
|
jsonArrayFields,
|
|
74
|
-
querySchema,
|
|
75
75
|
relations,
|
|
76
76
|
table
|
|
77
77
|
})(
|
|
@@ -79,7 +79,10 @@ var createGetOperation = ({
|
|
|
79
79
|
Object.fromEntries(new URL(req.url).searchParams),
|
|
80
80
|
params
|
|
81
81
|
)
|
|
82
|
-
);
|
|
82
|
+
) || {};
|
|
83
|
+
if (onSuccess) {
|
|
84
|
+
result = await onSuccess(result);
|
|
85
|
+
}
|
|
83
86
|
return import_next_rest_framework.TypedNextResponse.json(result, { status: 200 });
|
|
84
87
|
});
|
|
85
88
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -6,11 +6,12 @@ export interface PostOperationOptions<T extends ZodSchema, TTable extends PgTabl
|
|
|
6
6
|
bodySchema: T;
|
|
7
7
|
setBody?: (req: NextRequest) => Promise<Partial<z.infer<T>>>;
|
|
8
8
|
summary?: string;
|
|
9
|
+
onSuccess?: (data: z.infer<T>) => Promise<z.infer<T>>;
|
|
9
10
|
table: TTable;
|
|
10
11
|
}
|
|
11
|
-
export declare const createPostOperation:
|
|
12
|
+
export declare const createPostOperation: ({ getSession, db, }: {
|
|
12
13
|
db: NodePgDatabase<any>;
|
|
13
14
|
getSession: (req: NextRequest) => Promise<{
|
|
14
15
|
userId?: string;
|
|
15
16
|
} | undefined>;
|
|
16
|
-
}) => ({ bodySchema, setBody, summary, table }: PostOperationOptions<T, TTable>) => any;
|
|
17
|
+
}) => <T extends z.ZodType<any, z.ZodTypeDef, any>, TTable extends PgTable<import("drizzle-orm/pg-core").TableConfig>>({ bodySchema, setBody, summary, table, onSuccess, }: PostOperationOptions<T, TTable>) => any;
|
|
@@ -39,7 +39,13 @@ var import_actions = require("../actions");
|
|
|
39
39
|
var createPostOperation = ({
|
|
40
40
|
getSession,
|
|
41
41
|
db
|
|
42
|
-
}) => ({
|
|
42
|
+
}) => ({
|
|
43
|
+
bodySchema,
|
|
44
|
+
setBody,
|
|
45
|
+
summary,
|
|
46
|
+
table,
|
|
47
|
+
onSuccess
|
|
48
|
+
}) => (0, import_next_rest_framework.routeOperation)({
|
|
43
49
|
method: "POST",
|
|
44
50
|
openApiOperation: {
|
|
45
51
|
summary,
|
|
@@ -60,10 +66,13 @@ var createPostOperation = ({
|
|
|
60
66
|
await (setBody == null ? void 0 : setBody(req)) || {},
|
|
61
67
|
await req.json()
|
|
62
68
|
);
|
|
63
|
-
|
|
69
|
+
let [data] = await (0, import_actions.createPostAction)({ bodySchema, db, table })({
|
|
64
70
|
...body,
|
|
65
71
|
creatorId: userId
|
|
66
72
|
});
|
|
73
|
+
if (onSuccess) {
|
|
74
|
+
data = await onSuccess(data);
|
|
75
|
+
}
|
|
67
76
|
return import_next_rest_framework.TypedNextResponse.json(data, { status: 200 });
|
|
68
77
|
});
|
|
69
78
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2,15 +2,17 @@ import { z, ZodSchema } from "zod";
|
|
|
2
2
|
import { PgTable } from "drizzle-orm/pg-core";
|
|
3
3
|
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
4
4
|
import { NextRequest } from "next/server";
|
|
5
|
+
import { BaseTable } from "../types";
|
|
5
6
|
export interface PutOperationOptions<T extends ZodSchema, TTable extends PgTable> {
|
|
6
7
|
bodySchema: T;
|
|
7
8
|
table: TTable;
|
|
8
9
|
summary?: string;
|
|
9
10
|
setBody?: (req: NextRequest) => Promise<Partial<z.infer<T>>>;
|
|
11
|
+
onSuccess?: (data: z.infer<T>) => Promise<z.infer<T>>;
|
|
10
12
|
}
|
|
11
|
-
export declare const createPutOperation:
|
|
13
|
+
export declare const createPutOperation: ({ getSession, db, }: {
|
|
12
14
|
getSession: (req: NextRequest) => Promise<{
|
|
13
15
|
userId?: string;
|
|
14
16
|
} | undefined>;
|
|
15
17
|
db: NodePgDatabase<any>;
|
|
16
|
-
}) => ({ bodySchema, table, summary, setBody }: PutOperationOptions<T, TTable>) => any;
|
|
18
|
+
}) => <T extends z.ZodType<any, z.ZodTypeDef, any>, TTable extends BaseTable>({ bodySchema, table, summary, setBody, onSuccess, }: PutOperationOptions<T, TTable>) => any;
|
|
@@ -38,7 +38,13 @@ var import_actions = require("../actions");
|
|
|
38
38
|
var createPutOperation = ({
|
|
39
39
|
getSession,
|
|
40
40
|
db
|
|
41
|
-
}) => ({
|
|
41
|
+
}) => ({
|
|
42
|
+
bodySchema,
|
|
43
|
+
table,
|
|
44
|
+
summary,
|
|
45
|
+
setBody,
|
|
46
|
+
onSuccess
|
|
47
|
+
}) => (0, import_next_rest_framework.routeOperation)({
|
|
42
48
|
method: "PUT",
|
|
43
49
|
openApiOperation: {
|
|
44
50
|
summary,
|
|
@@ -53,17 +59,18 @@ var createPutOperation = ({
|
|
|
53
59
|
await (setBody == null ? void 0 : setBody(req)) || {},
|
|
54
60
|
await req.json()
|
|
55
61
|
);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
let data = await (0, import_actions.createPutAction)({
|
|
63
|
+
bodySchema,
|
|
64
|
+
table,
|
|
65
|
+
db
|
|
66
|
+
})({
|
|
67
|
+
...body,
|
|
68
|
+
editorId: userId
|
|
69
|
+
});
|
|
70
|
+
if (onSuccess) {
|
|
71
|
+
data = await onSuccess(data);
|
|
72
|
+
}
|
|
73
|
+
return import_next_rest_framework.TypedNextResponse.json(data, { status: 200 });
|
|
67
74
|
});
|
|
68
75
|
// Annotate the CommonJS export names for ESM import in node:
|
|
69
76
|
0 && (module.exports = {
|
|
@@ -2,6 +2,14 @@ import { AnyZodObject, z } from "zod";
|
|
|
2
2
|
import { PgColumnBuilderBase, PgTableExtraConfigValue } from "drizzle-orm/pg-core";
|
|
3
3
|
import { BuildExtraConfigColumns } from "drizzle-orm";
|
|
4
4
|
import { BuildSchema } from "drizzle-zod/schema.types.internal";
|
|
5
|
+
export declare const basicFields: {
|
|
6
|
+
id: import("drizzle-orm").IsPrimaryKey<import("drizzle-orm").NotNull<import("drizzle-orm").HasDefault<import("drizzle-orm/pg-core").PgUUIDBuilderInitial<"id">>>>;
|
|
7
|
+
creatorId: import("drizzle-orm/pg-core").PgUUIDBuilderInitial<"creator_id">;
|
|
8
|
+
editorId: import("drizzle-orm/pg-core").PgUUIDBuilderInitial<"editor_id">;
|
|
9
|
+
accessedAt: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTimestampBuilderInitial<string>>>;
|
|
10
|
+
createdAt: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTimestampBuilderInitial<string>>>;
|
|
11
|
+
updatedAt: import("drizzle-orm").HasDefault<import("drizzle-orm").NotNull<import("drizzle-orm/pg-core").PgTimestampBuilderInitial<string>>>;
|
|
12
|
+
};
|
|
5
13
|
export declare const queryListSchema: <Incoming extends AnyZodObject>(schema: Incoming) => z.ZodObject<z.objectUtil.extendShape<{
|
|
6
14
|
current: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
7
15
|
pageSize: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -4665,9 +4673,9 @@ export declare const createTableSchema: <TTableName extends string, TColumnsMap
|
|
|
4665
4673
|
queryListSchema: z.ZodObject<{} & {
|
|
4666
4674
|
[x: string]: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<any | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null> | z.ZodNullable<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<any | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many">> | z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<any | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many">> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<any | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many"> | z.ZodTuple<[any, ...any[]], null>, "many">>> | z.ZodNullable<z.ZodTuple<[any, ...any[]], null>> | z.ZodOptional<z.ZodTuple<[any, ...any[]], null>> | z.ZodOptional<z.ZodNullable<z.ZodTuple<[any, ...any[]], null>>>>;
|
|
4667
4675
|
}, "strip", z.ZodTypeAny, {
|
|
4668
|
-
[x: string]: [any, ...any[]] |
|
|
4676
|
+
[x: string]: unknown[] | [any, ...any[]] | null | undefined;
|
|
4669
4677
|
}, {
|
|
4670
|
-
[x: string]: [any, ...any[]] |
|
|
4678
|
+
[x: string]: unknown[] | [any, ...any[]] | null | undefined;
|
|
4671
4679
|
}>;
|
|
4672
4680
|
queryListSelectSchema: BuildSchema<any, any, any>;
|
|
4673
4681
|
};
|
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/backend/schemas/index.ts
|
|
20
20
|
var schemas_exports = {};
|
|
21
21
|
__export(schemas_exports, {
|
|
22
|
+
basicFields: () => basicFields,
|
|
22
23
|
createTableSchema: () => createTableSchema,
|
|
23
24
|
listBodySchema: () => listBodySchema,
|
|
24
25
|
queryListSchema: () => queryListSchema
|
|
@@ -92,6 +93,7 @@ var createTableSchema = ({
|
|
|
92
93
|
};
|
|
93
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
94
95
|
0 && (module.exports = {
|
|
96
|
+
basicFields,
|
|
95
97
|
createTableSchema,
|
|
96
98
|
listBodySchema,
|
|
97
99
|
queryListSchema
|
package/lib/backend/types.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { PgColumn, PgTable } from "drizzle-orm/pg-core";
|
|
2
2
|
import { SQL } from "drizzle-orm";
|
|
3
3
|
export interface BaseTable extends PgTable {
|
|
4
|
-
createdAt: PgColumn;
|
|
5
4
|
id: PgColumn;
|
|
5
|
+
creatorId: PgColumn;
|
|
6
|
+
editorId: PgColumn;
|
|
7
|
+
accessedAt: PgColumn;
|
|
8
|
+
createdAt: PgColumn;
|
|
9
|
+
updatedAt: PgColumn;
|
|
6
10
|
}
|
|
7
11
|
export type GetListRelations = {
|
|
8
12
|
groupBy?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai0x0/utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "AI0x0 utils",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai0x0"
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"build:watch": "father dev",
|
|
29
29
|
"docs:build": "dumi build",
|
|
30
30
|
"docs:dev": "dumi dev",
|
|
31
|
-
"prepack": "npm run build && clean-package",
|
|
32
31
|
"prepare": "husky install",
|
|
33
32
|
"prepublishOnly": "npm run build",
|
|
34
33
|
"release": "semantic-release",
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
],
|
|
41
40
|
"*.{ts,tsx,js}": [
|
|
42
41
|
"eslint",
|
|
43
|
-
"tsc
|
|
42
|
+
"tsc-files --noEmit"
|
|
44
43
|
]
|
|
45
44
|
},
|
|
46
45
|
"dependencies": {
|
|
@@ -76,6 +75,7 @@
|
|
|
76
75
|
"react": "^19.0.0",
|
|
77
76
|
"react-dom": "^19.0.0",
|
|
78
77
|
"remark-cli": "^11",
|
|
78
|
+
"tsc-files": "^1.1.4",
|
|
79
79
|
"tsx": "^4.19.3",
|
|
80
80
|
"typescript": "^5.8.2"
|
|
81
81
|
},
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ZodSchema } from "zod";
|
|
2
|
-
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
3
|
-
import { BaseTable, GetListRelations } from "../types";
|
|
4
|
-
export declare function getActionFn<T extends ZodSchema, Q extends ZodSchema, TTable extends BaseTable>({ bodySchema, db, jsonArrayFields, querySchema, relations, table, }: {
|
|
5
|
-
bodySchema: T;
|
|
6
|
-
db: NodePgDatabase<any>;
|
|
7
|
-
jsonArrayFields?: string[];
|
|
8
|
-
querySchema: Q;
|
|
9
|
-
relations?: GetListRelations;
|
|
10
|
-
table: TTable;
|
|
11
|
-
}): any;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z, ZodSchema } from "zod";
|
|
2
|
-
import { PgTable } from "drizzle-orm/pg-core";
|
|
3
|
-
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
4
|
-
export declare function postActionFn<T extends ZodSchema, TTable extends PgTable>({ bodySchema, table, db, }: {
|
|
5
|
-
bodySchema: T;
|
|
6
|
-
db: NodePgDatabase<any>;
|
|
7
|
-
table: TTable;
|
|
8
|
-
}): import("next-rest-framework/dist/index-Xbs7wi4f").R<"application/json", any, {
|
|
9
|
-
body: z.ZodArray<T, "many">;
|
|
10
|
-
contentType: "application/json";
|
|
11
|
-
status: number;
|
|
12
|
-
}[], true, Promise<T["_output"][]>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ZodSchema } from "zod";
|
|
2
|
-
import { PgTable } from "drizzle-orm/pg-core";
|
|
3
|
-
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
4
|
-
export declare function putActionFn<T extends ZodSchema, TTable extends PgTable>({ db, bodySchema, table, }: {
|
|
5
|
-
bodySchema: T;
|
|
6
|
-
db: NodePgDatabase<any>;
|
|
7
|
-
table: TTable;
|
|
8
|
-
}): any;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ZodSchema } from "zod";
|
|
2
|
-
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
3
|
-
import { BaseTable, GetListRelations } from "../types";
|
|
4
|
-
export declare function getActionFn<T extends ZodSchema, Q extends ZodSchema, TTable extends BaseTable>({ bodySchema, db, jsonArrayFields, querySchema, relations, table, }: {
|
|
5
|
-
bodySchema: T;
|
|
6
|
-
db: NodePgDatabase<any>;
|
|
7
|
-
jsonArrayFields?: string[];
|
|
8
|
-
querySchema: Q;
|
|
9
|
-
relations?: GetListRelations;
|
|
10
|
-
table: TTable;
|
|
11
|
-
}): any;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z, ZodSchema } from "zod";
|
|
2
|
-
import { PgTable } from "drizzle-orm/pg-core";
|
|
3
|
-
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
4
|
-
export declare function postActionFn<T extends ZodSchema, TTable extends PgTable>({ bodySchema, table, db, }: {
|
|
5
|
-
bodySchema: T;
|
|
6
|
-
db: NodePgDatabase<any>;
|
|
7
|
-
table: TTable;
|
|
8
|
-
}): import("next-rest-framework/dist/index-Xbs7wi4f").R<"application/json", any, {
|
|
9
|
-
body: z.ZodArray<T, "many">;
|
|
10
|
-
contentType: "application/json";
|
|
11
|
-
status: number;
|
|
12
|
-
}[], true, Promise<T["_output"][]>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ZodSchema } from "zod";
|
|
2
|
-
import { PgTable } from "drizzle-orm/pg-core";
|
|
3
|
-
import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
4
|
-
export declare function putActionFn<T extends ZodSchema, TTable extends PgTable>({ db, bodySchema, table, }: {
|
|
5
|
-
bodySchema: T;
|
|
6
|
-
db: NodePgDatabase<any>;
|
|
7
|
-
table: TTable;
|
|
8
|
-
}): any;
|