@ai0x0/utils 0.0.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.
- package/LICENSE +21 -0
- package/es/backend/actions/delete-action-fn.d.ts +7 -0
- package/es/backend/actions/delete-action-fn.d.ts.map +1 -0
- package/es/backend/actions/delete-action-fn.js +30 -0
- package/es/backend/actions/get-List-query.d.ts +30 -0
- package/es/backend/actions/get-List-query.d.ts.map +1 -0
- package/es/backend/actions/get-List-query.js +212 -0
- package/es/backend/actions/get-action-fn.d.ts +12 -0
- package/es/backend/actions/get-action-fn.d.ts.map +1 -0
- package/es/backend/actions/get-action-fn.js +75 -0
- package/es/backend/actions/get-list-action-fn.d.ts +12 -0
- package/es/backend/actions/get-list-action-fn.d.ts.map +1 -0
- package/es/backend/actions/get-list-action-fn.js +68 -0
- package/es/backend/actions/get-list-data.d.ts +8 -0
- package/es/backend/actions/get-list-data.d.ts.map +1 -0
- package/es/backend/actions/get-list-data.js +49 -0
- package/es/backend/actions/index.d.ts +6 -0
- package/es/backend/actions/index.d.ts.map +1 -0
- package/es/backend/actions/index.js +5 -0
- package/es/backend/actions/post-action-fn.d.ts +13 -0
- package/es/backend/actions/post-action-fn.d.ts.map +1 -0
- package/es/backend/actions/post-action-fn.js +35 -0
- package/es/backend/actions/put-action-fn.d.ts +9 -0
- package/es/backend/actions/put-action-fn.d.ts.map +1 -0
- package/es/backend/actions/put-action-fn.js +34 -0
- package/es/backend/actions/transform-body.d.ts +2 -0
- package/es/backend/actions/transform-body.d.ts.map +1 -0
- package/es/backend/actions/transform-body.js +11 -0
- package/es/backend/index.d.ts +3 -0
- package/es/backend/index.d.ts.map +1 -0
- package/es/backend/index.js +2 -0
- package/es/backend/route-operation/delete-operation.d.ts +10 -0
- package/es/backend/route-operation/delete-operation.d.ts.map +1 -0
- package/es/backend/route-operation/delete-operation.js +59 -0
- package/es/backend/route-operation/get-list-operation.d.ts +24 -0
- package/es/backend/route-operation/get-list-operation.d.ts.map +1 -0
- package/es/backend/route-operation/get-list-operation.js +83 -0
- package/es/backend/route-operation/get-operation.d.ts +17 -0
- package/es/backend/route-operation/get-operation.d.ts.map +1 -0
- package/es/backend/route-operation/get-operation.js +65 -0
- package/es/backend/route-operation/get-table-name.d.ts +4 -0
- package/es/backend/route-operation/get-table-name.d.ts.map +1 -0
- package/es/backend/route-operation/get-table-name.js +13 -0
- package/es/backend/route-operation/index.d.ts +6 -0
- package/es/backend/route-operation/index.d.ts.map +1 -0
- package/es/backend/route-operation/index.js +5 -0
- package/es/backend/route-operation/post-operation.d.ts +14 -0
- package/es/backend/route-operation/post-operation.d.ts.map +1 -0
- package/es/backend/route-operation/post-operation.js +84 -0
- package/es/backend/route-operation/put-operation.d.ts +14 -0
- package/es/backend/route-operation/put-operation.d.ts.map +1 -0
- package/es/backend/route-operation/put-operation.js +71 -0
- package/es/backend/schemas/index.d.ts +4674 -0
- package/es/backend/schemas/index.d.ts.map +1 -0
- package/es/backend/schemas/index.js +87 -0
- package/es/backend/types.d.ts +13 -0
- package/es/backend/types.d.ts.map +1 -0
- package/es/backend/types.js +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +0 -0
- package/lib/backend/actions/delete-action-fn.d.ts +7 -0
- package/lib/backend/actions/delete-action-fn.d.ts.map +1 -0
- package/lib/backend/actions/delete-action-fn.js +42 -0
- package/lib/backend/actions/get-List-query.d.ts +30 -0
- package/lib/backend/actions/get-List-query.d.ts.map +1 -0
- package/lib/backend/actions/get-List-query.js +162 -0
- package/lib/backend/actions/get-action-fn.d.ts +12 -0
- package/lib/backend/actions/get-action-fn.d.ts.map +1 -0
- package/lib/backend/actions/get-action-fn.js +75 -0
- package/lib/backend/actions/get-list-action-fn.d.ts +12 -0
- package/lib/backend/actions/get-list-action-fn.d.ts.map +1 -0
- package/lib/backend/actions/get-list-action-fn.js +74 -0
- package/lib/backend/actions/get-list-data.d.ts +8 -0
- package/lib/backend/actions/get-list-data.d.ts.map +1 -0
- package/lib/backend/actions/get-list-data.js +48 -0
- package/lib/backend/actions/index.d.ts +6 -0
- package/lib/backend/actions/index.d.ts.map +1 -0
- package/lib/backend/actions/index.js +41 -0
- package/lib/backend/actions/post-action-fn.d.ts +13 -0
- package/lib/backend/actions/post-action-fn.d.ts.map +1 -0
- package/lib/backend/actions/post-action-fn.js +49 -0
- package/lib/backend/actions/put-action-fn.d.ts +9 -0
- package/lib/backend/actions/put-action-fn.d.ts.map +1 -0
- package/lib/backend/actions/put-action-fn.js +43 -0
- package/lib/backend/actions/transform-body.d.ts +2 -0
- package/lib/backend/actions/transform-body.d.ts.map +1 -0
- package/lib/backend/actions/transform-body.js +47 -0
- package/lib/backend/index.d.ts +3 -0
- package/lib/backend/index.d.ts.map +1 -0
- package/lib/backend/index.js +25 -0
- package/lib/backend/route-operation/delete-operation.d.ts +10 -0
- package/lib/backend/route-operation/delete-operation.d.ts.map +1 -0
- package/lib/backend/route-operation/delete-operation.js +59 -0
- package/lib/backend/route-operation/get-list-operation.d.ts +24 -0
- package/lib/backend/route-operation/get-list-operation.d.ts.map +1 -0
- package/lib/backend/route-operation/get-list-operation.js +87 -0
- package/lib/backend/route-operation/get-operation.d.ts +17 -0
- package/lib/backend/route-operation/get-operation.d.ts.map +1 -0
- package/lib/backend/route-operation/get-operation.js +82 -0
- package/lib/backend/route-operation/get-table-name.d.ts +4 -0
- package/lib/backend/route-operation/get-table-name.d.ts.map +1 -0
- package/lib/backend/route-operation/get-table-name.js +35 -0
- package/lib/backend/route-operation/index.d.ts +6 -0
- package/lib/backend/route-operation/index.d.ts.map +1 -0
- package/lib/backend/route-operation/index.js +31 -0
- package/lib/backend/route-operation/post-operation.d.ts +14 -0
- package/lib/backend/route-operation/post-operation.d.ts.map +1 -0
- package/lib/backend/route-operation/post-operation.js +67 -0
- package/lib/backend/route-operation/put-operation.d.ts +14 -0
- package/lib/backend/route-operation/put-operation.d.ts.map +1 -0
- package/lib/backend/route-operation/put-operation.js +66 -0
- package/lib/backend/schemas/index.d.ts +4674 -0
- package/lib/backend/schemas/index.d.ts.map +1 -0
- package/lib/backend/schemas/index.js +98 -0
- package/lib/backend/types.d.ts +13 -0
- package/lib/backend/types.d.ts.map +1 -0
- package/lib/backend/types.js +17 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +0 -0
- package/package.json +86 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,CAAC,EAAc,MAAM,KAAK,CAAC;AAClD,OAAO,EACL,mBAAmB,EAEnB,uBAAuB,EAGxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAmBhE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;sFAaV,CAAC;AAGnB,eAAO,MAAM,cAAc;;;;;;;;;EAIvB,CAAC;AAGL,eAAO,MAAM,iBAAiB;;;0BAWpB,wBACJ,MAAM,EACN,OAAO,MAAM,EAAE,mBAAmB,CAAC,EACnC,IAAI,CACL,KACE,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC/B,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/backend/schemas/index.ts
|
|
20
|
+
var schemas_exports = {};
|
|
21
|
+
__export(schemas_exports, {
|
|
22
|
+
createTableSchema: () => createTableSchema,
|
|
23
|
+
listBodySchema: () => listBodySchema,
|
|
24
|
+
queryListSchema: () => queryListSchema
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(schemas_exports);
|
|
27
|
+
var import_zod = require("zod");
|
|
28
|
+
var import_pg_core = require("drizzle-orm/pg-core");
|
|
29
|
+
var import_drizzle_zod = require("drizzle-zod");
|
|
30
|
+
var timestamptz = (name) => (0, import_pg_core.timestamp)(name, { withTimezone: true });
|
|
31
|
+
var createdAt = () => timestamptz("created_at").notNull().defaultNow();
|
|
32
|
+
var updatedAt = () => timestamptz("updated_at").notNull().defaultNow();
|
|
33
|
+
var accessedAt = () => timestamptz("accessed_at").notNull().defaultNow();
|
|
34
|
+
var basicFields = {
|
|
35
|
+
id: (0, import_pg_core.uuid)("id").defaultRandom().primaryKey(),
|
|
36
|
+
creatorId: (0, import_pg_core.uuid)("creator_id"),
|
|
37
|
+
editorId: (0, import_pg_core.uuid)("editor_id"),
|
|
38
|
+
accessedAt: accessedAt(),
|
|
39
|
+
createdAt: createdAt(),
|
|
40
|
+
updatedAt: updatedAt()
|
|
41
|
+
};
|
|
42
|
+
var queryListSchema = (schema) => import_zod.z.object({
|
|
43
|
+
current: import_zod.z.string().optional().default("1"),
|
|
44
|
+
// 默认页码为 1
|
|
45
|
+
pageSize: import_zod.z.string().optional().default("10"),
|
|
46
|
+
// 默认每页条数为 10
|
|
47
|
+
createdAtFrom: import_zod.z.string().optional(),
|
|
48
|
+
// 筛选开始日期
|
|
49
|
+
createdAtTo: import_zod.z.string().optional(),
|
|
50
|
+
// 筛选结束日期
|
|
51
|
+
orderBy: import_zod.z.string().optional(),
|
|
52
|
+
creatorId: import_zod.z.string().optional(),
|
|
53
|
+
orderDir: import_zod.z.enum(["asc", "desc"]).optional()
|
|
54
|
+
}).merge(schema);
|
|
55
|
+
var listBodySchema = (schema) => import_zod.z.object({
|
|
56
|
+
total: import_zod.z.number(),
|
|
57
|
+
data: import_zod.z.array(schema)
|
|
58
|
+
});
|
|
59
|
+
var createTableSchema = ({
|
|
60
|
+
name,
|
|
61
|
+
columns,
|
|
62
|
+
extraConfig
|
|
63
|
+
}) => {
|
|
64
|
+
const table = (0, import_pg_core.pgTable)(
|
|
65
|
+
name,
|
|
66
|
+
{
|
|
67
|
+
...basicFields,
|
|
68
|
+
...columns
|
|
69
|
+
},
|
|
70
|
+
extraConfig
|
|
71
|
+
);
|
|
72
|
+
const selectSchema = (0, import_drizzle_zod.createSelectSchema)(table);
|
|
73
|
+
return {
|
|
74
|
+
table,
|
|
75
|
+
selectSchema,
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
insertSchema: (0, import_drizzle_zod.createInsertSchema)(table, {}),
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
updateSchema: (0, import_drizzle_zod.createUpdateSchema)(table, {
|
|
82
|
+
id: import_zod.z.string()
|
|
83
|
+
}),
|
|
84
|
+
querySchema: selectSchema.pick({
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
id: true
|
|
88
|
+
}),
|
|
89
|
+
queryListSchema: queryListSchema(selectSchema.partial()),
|
|
90
|
+
queryListSelectSchema: selectSchema
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
createTableSchema,
|
|
96
|
+
listBodySchema,
|
|
97
|
+
queryListSchema
|
|
98
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PgColumn, PgTable } from "drizzle-orm/pg-core";
|
|
2
|
+
import { SQL } from "drizzle-orm";
|
|
3
|
+
export interface BaseTable extends PgTable {
|
|
4
|
+
createdAt: PgColumn;
|
|
5
|
+
id: PgColumn;
|
|
6
|
+
}
|
|
7
|
+
export type GetListRelations = {
|
|
8
|
+
groupBy?: boolean;
|
|
9
|
+
select?: Record<string, unknown>;
|
|
10
|
+
sql?: SQL;
|
|
11
|
+
table?: BaseTable;
|
|
12
|
+
}[];
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,MAAM,WAAW,SAAU,SAAQ,OAAO;IACxC,SAAS,EAAE,QAAQ,CAAC;IACpB,EAAE,EAAE,QAAQ,CAAC;CACd;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/backend/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
package/lib/index.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ai0x0/utils",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "AI0x0 utils",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai0x0"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/ai0x0/utils",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/ai0x0/utils/issues/new"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/ai0x0/utils.git"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "AI0x0 <i@ai0x0.com>",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"main": "./lib/index.js",
|
|
20
|
+
"module": "./es/index.js",
|
|
21
|
+
"types": "./lib/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"lib",
|
|
24
|
+
"es"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "father build",
|
|
28
|
+
"build:watch": "father dev",
|
|
29
|
+
"docs:build": "dumi build",
|
|
30
|
+
"docs:dev": "dumi dev",
|
|
31
|
+
"prepack": "npm run build && clean-package",
|
|
32
|
+
"prepare": "husky install",
|
|
33
|
+
"prepublishOnly": "npm run build",
|
|
34
|
+
"release": "semantic-release",
|
|
35
|
+
"start": "npm run docs:dev"
|
|
36
|
+
},
|
|
37
|
+
"lint-staged": {
|
|
38
|
+
"*": [
|
|
39
|
+
"pretty-quick --staged"
|
|
40
|
+
],
|
|
41
|
+
"*.{ts,tsx,js}": [
|
|
42
|
+
"eslint",
|
|
43
|
+
"bash -c tsc -p tsconfig.check.json"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"dayjs": "^1.11.13",
|
|
48
|
+
"drizzle-orm": "^0.38.3",
|
|
49
|
+
"drizzle-zod": "^0.7.1",
|
|
50
|
+
"next": "^15.3.2",
|
|
51
|
+
"next-rest-framework": "npm:@infoxchange/next-rest-framework-patch@^6.0.6",
|
|
52
|
+
"zod": "^3.24.4"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@commitlint/cli": "^19.8.0",
|
|
56
|
+
"@testing-library/react": "^16.2.0",
|
|
57
|
+
"@types/react": "^19.0.12",
|
|
58
|
+
"@types/react-dom": "^19.0.4",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
60
|
+
"antd": "^5.24.5",
|
|
61
|
+
"babel-plugin-antd-style": "^1.0.4",
|
|
62
|
+
"clean-package": "^2.2.0",
|
|
63
|
+
"commitlint": "^19.8.0",
|
|
64
|
+
"cross-env": "^7.0.3",
|
|
65
|
+
"dumi": "^2.4.18",
|
|
66
|
+
"dumi-theme-lobehub": "^2.0.0",
|
|
67
|
+
"eslint": "^8.57.1",
|
|
68
|
+
"eslint-config-next": "^15.3.2",
|
|
69
|
+
"eslint-config-prettier": "^10.1.5",
|
|
70
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
71
|
+
"father": "^4.5.2",
|
|
72
|
+
"husky": "^9.1.7",
|
|
73
|
+
"lint-staged": "^15.5.0",
|
|
74
|
+
"prettier": "^3.5.3",
|
|
75
|
+
"pretty-quick": "^4.1.1",
|
|
76
|
+
"react": "^19.0.0",
|
|
77
|
+
"react-dom": "^19.0.0",
|
|
78
|
+
"remark-cli": "^11",
|
|
79
|
+
"tsx": "^4.19.3",
|
|
80
|
+
"typescript": "^5.8.2"
|
|
81
|
+
},
|
|
82
|
+
"publishConfig": {
|
|
83
|
+
"access": "public",
|
|
84
|
+
"registry": "https://registry.npmjs.org"
|
|
85
|
+
}
|
|
86
|
+
}
|