onecore 0.6.7 → 0.6.9
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/README.md +9 -43
- package/package.json +1 -1
- package/src/db.ts +3 -0
- package/src/job.ts +50 -71
- package/src/logger.ts +10 -10
- package/src/metadata.ts +2 -0
package/README.md
CHANGED
|
@@ -1973,49 +1973,15 @@ interface Logger {
|
|
|
1973
1973
|
name: Name;
|
|
1974
1974
|
level: number;
|
|
1975
1975
|
map: LogMap;
|
|
1976
|
-
constants?:
|
|
1977
|
-
|
|
1978
|
-
trace(
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
): void;
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
msg: string,
|
|
1986
|
-
m?: SimpleMap,
|
|
1987
|
-
ctx?: any
|
|
1988
|
-
): void;
|
|
1989
|
-
|
|
1990
|
-
info(
|
|
1991
|
-
msg: string,
|
|
1992
|
-
m?: SimpleMap,
|
|
1993
|
-
ctx?: any
|
|
1994
|
-
): void;
|
|
1995
|
-
|
|
1996
|
-
warn(
|
|
1997
|
-
msg: string,
|
|
1998
|
-
m?: SimpleMap,
|
|
1999
|
-
ctx?: any
|
|
2000
|
-
): void;
|
|
2001
|
-
|
|
2002
|
-
error(
|
|
2003
|
-
msg: string,
|
|
2004
|
-
m?: SimpleMap,
|
|
2005
|
-
ctx?: any
|
|
2006
|
-
): void;
|
|
2007
|
-
|
|
2008
|
-
panic(
|
|
2009
|
-
msg: string,
|
|
2010
|
-
m?: SimpleMap,
|
|
2011
|
-
ctx?: any
|
|
2012
|
-
): void;
|
|
2013
|
-
|
|
2014
|
-
fatal(
|
|
2015
|
-
msg: string,
|
|
2016
|
-
m?: SimpleMap,
|
|
2017
|
-
ctx?: any
|
|
2018
|
-
): void;
|
|
1976
|
+
constants?: Context;
|
|
1977
|
+
|
|
1978
|
+
trace(msg: string, context?: Context, ctx?: any): void;
|
|
1979
|
+
debug(msg: string, context?: Context, ctx?: any): void;
|
|
1980
|
+
info(msg: string, context?: Context, ctx?: any): void;
|
|
1981
|
+
warn(msg: string, context?: Context, ctx?: any): void;
|
|
1982
|
+
error(msg: string, context?: Context, ctx?: any): void;
|
|
1983
|
+
panic(msg: string, context?: Context, ctx?: any): void;
|
|
1984
|
+
fatal(msg: string, context?: Context, ctx?: any): void;
|
|
2019
1985
|
|
|
2020
1986
|
isLevelEnabled(level: number): boolean;
|
|
2021
1987
|
isTraceEnabled(): boolean;
|
package/package.json
CHANGED
package/src/db.ts
CHANGED
|
@@ -20,6 +20,9 @@ export interface Executor {
|
|
|
20
20
|
execute(sql: string, args?: any[]): Promise<number>
|
|
21
21
|
executeBatch(statements: Statement[], requireFirstAffected?: boolean): Promise<number>
|
|
22
22
|
query<T>(sql: string, args?: any[], m?: StringMap, bools?: Attribute[]): Promise<T[]>
|
|
23
|
+
queryOne<T>(sql: string, args?: any[], m?: StringMap, bools?: Attribute[]): Promise<T | null>
|
|
24
|
+
executeScalar<T>(sql: string, args?: any[]): Promise<T | null>
|
|
25
|
+
count(sql: string, args?: any[]): Promise<number>
|
|
23
26
|
}
|
|
24
27
|
export interface Transaction extends Executor {
|
|
25
28
|
commit(): Promise<void>
|
package/src/job.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateRange, Filter,
|
|
1
|
+
import { DateRange, Filter, TimeRange } from "./model";
|
|
2
2
|
|
|
3
3
|
export interface Attachment {
|
|
4
4
|
originalFilename: string;
|
|
@@ -7,37 +7,6 @@ export interface Attachment {
|
|
|
7
7
|
size: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export interface Article {
|
|
11
|
-
id: string
|
|
12
|
-
slug: string
|
|
13
|
-
title: string
|
|
14
|
-
description?: string
|
|
15
|
-
publishedAt?: Date
|
|
16
|
-
tags?: string[]
|
|
17
|
-
thumbnail?: string
|
|
18
|
-
status?: string
|
|
19
|
-
createdAt?: Date
|
|
20
|
-
authorId?: string
|
|
21
|
-
savedAt?: Date
|
|
22
|
-
}
|
|
23
|
-
export interface ArticleFilter extends Filter {
|
|
24
|
-
id?: string
|
|
25
|
-
slug?: string
|
|
26
|
-
title?: string
|
|
27
|
-
description?: string
|
|
28
|
-
status?: string
|
|
29
|
-
publishedAt: TimeRange
|
|
30
|
-
tags?: string[]
|
|
31
|
-
authorId?: string
|
|
32
|
-
userId?: string
|
|
33
|
-
isSaved?: boolean
|
|
34
|
-
}
|
|
35
|
-
export interface ArticleRepository {
|
|
36
|
-
search(filter: ArticleFilter, limit: number, page?: number, fields?: string[]): Promise<SearchResult<Article>>
|
|
37
|
-
load(slug: string, userId?: string): Promise<Article | null>
|
|
38
|
-
getIdBySlug(slug: string): Promise<string>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
10
|
export interface Achievement {
|
|
42
11
|
subject: string;
|
|
43
12
|
description: string;
|
|
@@ -46,17 +15,7 @@ export interface Skill {
|
|
|
46
15
|
skill: string;
|
|
47
16
|
hirable: boolean;
|
|
48
17
|
}
|
|
49
|
-
|
|
50
|
-
userId?: string;
|
|
51
|
-
username?: string;
|
|
52
|
-
email?: string;
|
|
53
|
-
displayName?: string;
|
|
54
|
-
dateOfBirth?: DateRange;
|
|
55
|
-
status?: string[]|string;
|
|
56
|
-
interests?: string[];
|
|
57
|
-
skills?: Skill[];
|
|
58
|
-
achievements?: Achievement[];
|
|
59
|
-
}
|
|
18
|
+
|
|
60
19
|
export interface RoleFilter extends Filter {
|
|
61
20
|
roleId?: string;
|
|
62
21
|
roleName?: string;
|
|
@@ -91,35 +50,50 @@ export interface ReviewCommentFilter extends Filter {
|
|
|
91
50
|
time?: DateRange;
|
|
92
51
|
updatedAt?: DateRange;
|
|
93
52
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
rate: number
|
|
97
|
-
rate1: number
|
|
98
|
-
rate2: number
|
|
99
|
-
rate3: number
|
|
100
|
-
rate4: number
|
|
101
|
-
rate5: number
|
|
102
|
-
count: number;
|
|
103
|
-
score: number;
|
|
53
|
+
|
|
54
|
+
export interface Rate {
|
|
55
|
+
rate: number
|
|
56
|
+
rate1: number
|
|
57
|
+
rate2: number
|
|
58
|
+
rate3: number
|
|
59
|
+
rate4: number
|
|
60
|
+
rate5: number
|
|
104
61
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
count: number;
|
|
119
|
-
score: number;
|
|
62
|
+
|
|
63
|
+
export interface Article {
|
|
64
|
+
id: string
|
|
65
|
+
slug: string
|
|
66
|
+
title: string
|
|
67
|
+
description?: string
|
|
68
|
+
publishedAt?: Date
|
|
69
|
+
tags?: string[]
|
|
70
|
+
thumbnail?: string
|
|
71
|
+
status?: string
|
|
72
|
+
createdAt?: Date
|
|
73
|
+
authorId?: string
|
|
74
|
+
savedAt?: Date
|
|
120
75
|
}
|
|
121
|
-
|
|
122
|
-
|
|
76
|
+
|
|
77
|
+
export interface User {
|
|
78
|
+
id: string
|
|
79
|
+
username: string
|
|
80
|
+
email?: string
|
|
81
|
+
phone?: string
|
|
82
|
+
dateOfBirth?: Date
|
|
83
|
+
displayName?: string
|
|
84
|
+
status?: string
|
|
85
|
+
imageURL?: string
|
|
86
|
+
coverURL?: string
|
|
87
|
+
headline?: string
|
|
88
|
+
bio?: string
|
|
89
|
+
website?: string
|
|
90
|
+
occupation?: string
|
|
91
|
+
company?: string
|
|
92
|
+
location?: string
|
|
93
|
+
|
|
94
|
+
followedAt?: Date
|
|
95
|
+
followerCount?: number
|
|
96
|
+
followingCount?: number
|
|
123
97
|
}
|
|
124
98
|
|
|
125
99
|
export interface Company {
|
|
@@ -153,8 +127,11 @@ export interface Job {
|
|
|
153
127
|
skills?: string[]
|
|
154
128
|
minSalary?: number
|
|
155
129
|
maxSalary?: number
|
|
156
|
-
companyId?: string
|
|
157
130
|
status: string
|
|
131
|
+
companyId?: string
|
|
132
|
+
companyName?: string
|
|
133
|
+
logo?: string
|
|
134
|
+
savedAt?: Date
|
|
158
135
|
}
|
|
159
136
|
export interface JobFilter extends Filter {
|
|
160
137
|
id?: string
|
|
@@ -169,4 +146,6 @@ export interface JobFilter extends Filter {
|
|
|
169
146
|
applicantCount?: number
|
|
170
147
|
companyId?: string
|
|
171
148
|
status?: string
|
|
149
|
+
userId?: string
|
|
150
|
+
isSaved?: boolean
|
|
172
151
|
}
|
package/src/logger.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface NumberMap {
|
|
2
2
|
[key: string]: number;
|
|
3
3
|
}
|
|
4
|
-
export interface
|
|
4
|
+
export interface Context {
|
|
5
5
|
[key: string]: string | number | boolean | Date;
|
|
6
6
|
}
|
|
7
7
|
export interface LogMap {
|
|
@@ -17,7 +17,7 @@ export interface LogMapConfig {
|
|
|
17
17
|
export interface Config {
|
|
18
18
|
level?: string;
|
|
19
19
|
map?: LogMapConfig;
|
|
20
|
-
constants?:
|
|
20
|
+
constants?: Context;
|
|
21
21
|
name?: Name;
|
|
22
22
|
}
|
|
23
23
|
export type LogConf = Config;
|
|
@@ -37,14 +37,14 @@ export interface Logger {
|
|
|
37
37
|
name: Name;
|
|
38
38
|
level: number;
|
|
39
39
|
map: LogMap;
|
|
40
|
-
constants?:
|
|
41
|
-
trace(msg: string,
|
|
42
|
-
debug(msg: string,
|
|
43
|
-
info(msg: string,
|
|
44
|
-
warn(msg: string,
|
|
45
|
-
error(msg: string,
|
|
46
|
-
panic(msg: string,
|
|
47
|
-
fatal(msg: string,
|
|
40
|
+
constants?: Context;
|
|
41
|
+
trace(msg: string, context?: Context, ctx?: any): void;
|
|
42
|
+
debug(msg: string, context?: Context, ctx?: any): void;
|
|
43
|
+
info(msg: string, context?: Context, ctx?: any): void;
|
|
44
|
+
warn(msg: string, context?: Context, ctx?: any): void;
|
|
45
|
+
error(msg: string, context?: Context, ctx?: any): void;
|
|
46
|
+
panic(msg: string, context?: Context, ctx?: any): void;
|
|
47
|
+
fatal(msg: string, context?: Context, ctx?: any): void;
|
|
48
48
|
isLevelEnabled(level: number): boolean;
|
|
49
49
|
isTraceEnabled(): boolean;
|
|
50
50
|
isDebugEnabled(): boolean;
|
package/src/metadata.ts
CHANGED