@lark-apaas/devtool-kits 1.1.1-alpha.0 → 1.2.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/dist/error.html +194 -23
- package/dist/index.cjs +691 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +695 -20
- package/dist/index.js.map +1 -1
- package/dist/template/types.ts +8 -21
- package/package.json +3 -2
package/dist/template/types.ts
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
import { sql } from 'drizzle-orm';
|
|
2
2
|
import { customType } from 'drizzle-orm/pg-core';
|
|
3
3
|
|
|
4
|
-
export type UserProfile = {
|
|
5
|
-
user_id: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
4
|
export const userProfile = customType<{
|
|
9
|
-
data:
|
|
10
|
-
driverData:
|
|
5
|
+
data: string;
|
|
6
|
+
driverData: string;
|
|
11
7
|
}>({
|
|
12
8
|
dataType() {
|
|
13
9
|
return 'user_profile';
|
|
14
10
|
},
|
|
15
|
-
toDriver(value:
|
|
16
|
-
|
|
17
|
-
return sql`ROW(${value})::user_profile`;
|
|
18
|
-
}
|
|
19
|
-
return sql`ROW(${value.user_id})::user_profile`;
|
|
11
|
+
toDriver(value: string) {
|
|
12
|
+
return sql`ROW(${value})::user_profile`;
|
|
20
13
|
},
|
|
21
|
-
fromDriver(value:
|
|
22
|
-
if (typeof value !== 'string') {
|
|
23
|
-
throw new Error('Invalid user profile value');
|
|
24
|
-
}
|
|
14
|
+
fromDriver(value: string) {
|
|
25
15
|
const [userId] = value.slice(1, -1).split(',');
|
|
26
|
-
return
|
|
16
|
+
return userId.trim();
|
|
27
17
|
},
|
|
28
18
|
});
|
|
29
19
|
|
|
@@ -34,7 +24,7 @@ export type FileAttachment = {
|
|
|
34
24
|
|
|
35
25
|
export const fileAttachment = customType<{
|
|
36
26
|
data: FileAttachment;
|
|
37
|
-
driverData:
|
|
27
|
+
driverData: string;
|
|
38
28
|
}>({
|
|
39
29
|
dataType() {
|
|
40
30
|
return 'file_attachment';
|
|
@@ -42,10 +32,7 @@ export const fileAttachment = customType<{
|
|
|
42
32
|
toDriver(value: FileAttachment) {
|
|
43
33
|
return sql`ROW(${value.bucket_id},${value.file_path})::file_attachment`;
|
|
44
34
|
},
|
|
45
|
-
fromDriver(value:
|
|
46
|
-
if (typeof value !== 'string') {
|
|
47
|
-
throw new Error('Invalid file attachment value');
|
|
48
|
-
}
|
|
35
|
+
fromDriver(value: string): FileAttachment {
|
|
49
36
|
const [bucketId, filePath] = value.slice(1, -1).split(',');
|
|
50
37
|
return { bucket_id: bucketId.trim(), file_path: filePath.trim() };
|
|
51
38
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/devtool-kits",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "FullStack Devtool Kits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"pino": "^10.0.0",
|
|
41
|
-
"pinyin-pro": "^3.27.0"
|
|
41
|
+
"pinyin-pro": "^3.27.0",
|
|
42
|
+
"ts-morph": "^27.0.2"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/express": "^4.17.21",
|