@ai0x0/utils 0.4.0 → 0.5.0
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.
|
@@ -99,10 +99,12 @@ export var queryListSchema = function queryListSchema(schema) {
|
|
|
99
99
|
// =============================================================================
|
|
100
100
|
// 列表返回字段
|
|
101
101
|
// =============================================================================
|
|
102
|
+
// 这两个字段出现在**每一个** list 端点的响应里,所以说明写在这儿一次就够 —— 下游那边它们是
|
|
103
|
+
// 逐个 list 命令重复一遍的(在一个 101 端点的项目上是 24 行空白)。
|
|
102
104
|
export var listBodySchema = function listBodySchema(schema) {
|
|
103
105
|
return z.object({
|
|
104
|
-
total: z.number(),
|
|
105
|
-
data: z.array(schema)
|
|
106
|
+
total: z.number().describe("Total number of rows matching the filters — not the length of `data`. Use it to decide whether another page exists."),
|
|
107
|
+
data: z.array(schema).describe("This page's rows.")
|
|
106
108
|
});
|
|
107
109
|
};
|
|
108
110
|
|
|
@@ -105,10 +105,12 @@ export var queryListSchema = function queryListSchema(schema) {
|
|
|
105
105
|
// =============================================================================
|
|
106
106
|
// 列表返回字段
|
|
107
107
|
// =============================================================================
|
|
108
|
+
// 这两个字段出现在**每一个** list 端点的响应里,所以说明写在这儿一次就够 —— 下游那边它们是
|
|
109
|
+
// 逐个 list 命令重复一遍的(在一个 101 端点的项目上是 24 行空白)。
|
|
108
110
|
export var listBodySchema = function listBodySchema(schema) {
|
|
109
111
|
return z.object({
|
|
110
|
-
total: z.number(),
|
|
111
|
-
data: z.array(schema)
|
|
112
|
+
total: z.number().describe("Total number of rows matching the filters — not the length of `data`. Use it to decide whether another page exists."),
|
|
113
|
+
data: z.array(schema).describe("This page's rows.")
|
|
112
114
|
});
|
|
113
115
|
};
|
|
114
116
|
|
|
@@ -76,8 +76,10 @@ var queryListSchema = (schema) => import_zod.z.object({
|
|
|
76
76
|
orderDir: import_zod.z.enum(["asc", "desc"]).optional().describe("Sort ascending or descending.")
|
|
77
77
|
}).merge(schema);
|
|
78
78
|
var listBodySchema = (schema) => import_zod.z.object({
|
|
79
|
-
total: import_zod.z.number()
|
|
80
|
-
|
|
79
|
+
total: import_zod.z.number().describe(
|
|
80
|
+
"Total number of rows matching the filters — not the length of `data`. Use it to decide whether another page exists."
|
|
81
|
+
),
|
|
82
|
+
data: import_zod.z.array(schema).describe("This page's rows.")
|
|
81
83
|
});
|
|
82
84
|
var BASIC_FIELD_NOTES = {
|
|
83
85
|
creatorId: "User id of the creator. Stamped by the server; clients cannot send it.",
|
|
@@ -78,8 +78,10 @@ var queryListSchema = (schema) => import_zod.z.object({
|
|
|
78
78
|
orderDir: import_zod.z.enum(["asc", "desc"]).optional().describe("Sort ascending or descending.")
|
|
79
79
|
}).merge(schema);
|
|
80
80
|
var listBodySchema = (schema) => import_zod.z.object({
|
|
81
|
-
total: import_zod.z.number()
|
|
82
|
-
|
|
81
|
+
total: import_zod.z.number().describe(
|
|
82
|
+
"Total number of rows matching the filters — not the length of `data`. Use it to decide whether another page exists."
|
|
83
|
+
),
|
|
84
|
+
data: import_zod.z.array(schema).describe("This page's rows.")
|
|
83
85
|
});
|
|
84
86
|
var BASIC_FIELD_NOTES = {
|
|
85
87
|
creatorId: "User id of the creator. Stamped by the server; clients cannot send it.",
|