baja-lite 1.3.52 → 1.4.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 -21
- package/package.json +8 -9
- package/sqlite.js +29 -29
- package/test-xml.js +68 -68
- package/wx/base.js +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 void-soul
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 void-soul
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baja-lite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "some util for self",
|
|
5
5
|
"homepage": "https://github.com/void-soul/baja-lite",
|
|
6
6
|
"repository": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@msgpack/msgpack": "3.1.2",
|
|
39
39
|
"@types/request-promise": "4.1.51",
|
|
40
|
-
"axios": "1.
|
|
41
|
-
"baja-lite-field": "1.
|
|
40
|
+
"axios": "1.10.0",
|
|
41
|
+
"baja-lite-field": "1.4.0",
|
|
42
42
|
"decimal.js": "10.5.0",
|
|
43
43
|
"html-parse-stringify": "3.0.1",
|
|
44
44
|
"iterare": "1.2.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"reflect-metadata": "0.2.2",
|
|
50
50
|
"request": "2.88.2",
|
|
51
51
|
"request-promise": "4.2.6",
|
|
52
|
-
"sql-formatter": "15.6.
|
|
52
|
+
"sql-formatter": "15.6.4",
|
|
53
53
|
"sqlstring": "2.3.3",
|
|
54
54
|
"tslib": "2.8.1"
|
|
55
55
|
},
|
|
@@ -57,15 +57,14 @@
|
|
|
57
57
|
"@types/better-sqlite3": "7.6.13",
|
|
58
58
|
"@types/lodash.get": "4.4.9",
|
|
59
59
|
"@types/mustache": "4.2.6",
|
|
60
|
-
"@types/node": "
|
|
61
|
-
"@types/pg-pool": "2.0.6",
|
|
60
|
+
"@types/node": "24.0.3",
|
|
62
61
|
"@types/shelljs": "0.8.16",
|
|
63
62
|
"@types/sqlstring": "2.3.2",
|
|
64
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
65
|
-
"@typescript-eslint/parser": "8.
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "8.34.1",
|
|
64
|
+
"@typescript-eslint/parser": "8.34.1",
|
|
66
65
|
"better-sqlite3": "11.10.0",
|
|
67
66
|
"ioredis": "5.6.1",
|
|
68
|
-
"mongodb": "6.
|
|
67
|
+
"mongodb": "6.17.0",
|
|
69
68
|
"mysql2": "3.14.1",
|
|
70
69
|
"pg": "8.16.0",
|
|
71
70
|
"pg-pool": "3.10.0",
|
package/sqlite.js
CHANGED
|
@@ -24,10 +24,10 @@ export class SqliteRemoteClass {
|
|
|
24
24
|
return encode({ affectedRows: changes, insertId: lastInsertRowid ? BigInt(lastInsertRowid) : 0n }, { extensionCodec });
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
|
-
logger.error(`
|
|
28
|
-
error: ${error},
|
|
29
|
-
sql: ${sql},
|
|
30
|
-
params: ${params}
|
|
27
|
+
logger.error(`
|
|
28
|
+
error: ${error},
|
|
29
|
+
sql: ${sql},
|
|
30
|
+
params: ${params}
|
|
31
31
|
`);
|
|
32
32
|
throw error;
|
|
33
33
|
}
|
|
@@ -47,10 +47,10 @@ export class SqliteRemoteClass {
|
|
|
47
47
|
return encode(this.dbList[dbName].prepare(sql).pluck().get(params ?? {}), { extensionCodec });
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
|
-
logger.error(`
|
|
51
|
-
error: ${error},
|
|
52
|
-
sql: ${sql},
|
|
53
|
-
params: ${params}
|
|
50
|
+
logger.error(`
|
|
51
|
+
error: ${error},
|
|
52
|
+
sql: ${sql},
|
|
53
|
+
params: ${params}
|
|
54
54
|
`);
|
|
55
55
|
throw error;
|
|
56
56
|
}
|
|
@@ -65,10 +65,10 @@ export class SqliteRemoteClass {
|
|
|
65
65
|
return encode(this.dbList[dbName].prepare(sql).get(params ?? {}), { extensionCodec });
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
68
|
-
logger.error(`
|
|
69
|
-
error: ${error},
|
|
70
|
-
sql: ${sql},
|
|
71
|
-
params: ${params}
|
|
68
|
+
logger.error(`
|
|
69
|
+
error: ${error},
|
|
70
|
+
sql: ${sql},
|
|
71
|
+
params: ${params}
|
|
72
72
|
`);
|
|
73
73
|
throw error;
|
|
74
74
|
}
|
|
@@ -87,10 +87,10 @@ export class SqliteRemoteClass {
|
|
|
87
87
|
return encode(this.dbList[dbName].prepare(sql).raw().all(params ?? {}), { extensionCodec });
|
|
88
88
|
}
|
|
89
89
|
catch (error) {
|
|
90
|
-
logger.error(`
|
|
91
|
-
error: ${error},
|
|
92
|
-
sql: ${sql},
|
|
93
|
-
params: ${params}
|
|
90
|
+
logger.error(`
|
|
91
|
+
error: ${error},
|
|
92
|
+
sql: ${sql},
|
|
93
|
+
params: ${params}
|
|
94
94
|
`);
|
|
95
95
|
throw error;
|
|
96
96
|
}
|
|
@@ -109,10 +109,10 @@ export class SqliteRemoteClass {
|
|
|
109
109
|
return encode(this.dbList[dbName].prepare(sql).all(params ?? {}), { extensionCodec });
|
|
110
110
|
}
|
|
111
111
|
catch (error) {
|
|
112
|
-
logger.error(`
|
|
113
|
-
error: ${error},
|
|
114
|
-
sql: ${sql},
|
|
115
|
-
params: ${params}
|
|
112
|
+
logger.error(`
|
|
113
|
+
error: ${error},
|
|
114
|
+
sql: ${sql},
|
|
115
|
+
params: ${params}
|
|
116
116
|
`);
|
|
117
117
|
throw error;
|
|
118
118
|
}
|
|
@@ -121,15 +121,15 @@ export class SqliteRemoteClass {
|
|
|
121
121
|
if (!this.dbList[dbName]) {
|
|
122
122
|
this.dbList[dbName] = new this.BetterSqlite3(this.getStoreName(dbName), { fileMustExist: false });
|
|
123
123
|
this.dbList[dbName].pragma('journal_mode = WAL');
|
|
124
|
-
this.dbList[dbName].exec(`
|
|
125
|
-
CREATE TABLE IF NOT EXISTS DUAL ( ______id INTEGER NOT NULL, PRIMARY KEY ( ______id ));
|
|
126
|
-
DELETE FROM DUAL;
|
|
127
|
-
INSERT INTO DUAL (______id ) VALUES ( 1 );
|
|
128
|
-
CREATE TABLE IF NOT EXISTS TABLE_VERSION (
|
|
129
|
-
______tableName text NOT NULL,
|
|
130
|
-
______version text NOT NULL,
|
|
131
|
-
PRIMARY KEY ( ______tableName )
|
|
132
|
-
);
|
|
124
|
+
this.dbList[dbName].exec(`
|
|
125
|
+
CREATE TABLE IF NOT EXISTS DUAL ( ______id INTEGER NOT NULL, PRIMARY KEY ( ______id ));
|
|
126
|
+
DELETE FROM DUAL;
|
|
127
|
+
INSERT INTO DUAL (______id ) VALUES ( 1 );
|
|
128
|
+
CREATE TABLE IF NOT EXISTS TABLE_VERSION (
|
|
129
|
+
______tableName text NOT NULL,
|
|
130
|
+
______version text NOT NULL,
|
|
131
|
+
PRIMARY KEY ( ______tableName )
|
|
132
|
+
);
|
|
133
133
|
`);
|
|
134
134
|
}
|
|
135
135
|
}
|
package/test-xml.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
import HTML from 'html-parse-stringify';
|
|
2
|
-
console.log((HTML.parse(`
|
|
3
|
-
<sql id="reportField">
|
|
4
|
-
a.left_e_foul leftEFoul,
|
|
5
|
-
a.right_e_foul rightEFoul,
|
|
6
|
-
a.left_em_foul leftEmFoul,
|
|
7
|
-
a.right_em_foul rightEmFoul,
|
|
8
|
-
a.left_s_foul leftSFoul,
|
|
9
|
-
a.right_s_foul rightSFoul,
|
|
10
|
-
a.left_sb_foul leftSbFoul,
|
|
11
|
-
a.right_sb_foul rightSbFoul,
|
|
12
|
-
a.left_p_foul leftPFoul,
|
|
13
|
-
a.right_p_foul rightPFoul,
|
|
14
|
-
a.left_attack_goal leftAttackGoal,
|
|
15
|
-
a.right_attack_goal rightAttackGoal,
|
|
16
|
-
a.left_point_goal leftPointGoal,
|
|
17
|
-
a.right_point_goal rightPointGoal,
|
|
18
|
-
a.left_over_time_goal leftOverTimeGoal,
|
|
19
|
-
a.right_over_time_goal rightOverTimeGoal,
|
|
20
|
-
a.left_normal_goal leftNormalGoal,
|
|
21
|
-
a.right_normal_goal rightNormalGoal,
|
|
22
|
-
a.left_own_goal leftOwnGoal,
|
|
23
|
-
a.right_own_goal rightOwnGoal,
|
|
24
|
-
a.left_time_out leftTimeOut,
|
|
25
|
-
a.right_time_out rightTimeOut,
|
|
26
|
-
a.left_coach_y_card leftCoachYCard,
|
|
27
|
-
a.right_coach_y_card rightCoachYCard,
|
|
28
|
-
a.left_player_r_card leftPlayerRCard,
|
|
29
|
-
a.right_player_r_card rightPlayerRCard,
|
|
30
|
-
a.left_jump_ball leftJumpBall,
|
|
31
|
-
a.right_jump_ball rightJumpBall
|
|
32
|
-
</sql>
|
|
33
|
-
<select id="matchReport" resultType="org.jeecg.modules.event.entity.EventMatchReport">
|
|
34
|
-
select
|
|
35
|
-
b.event_name eventName,
|
|
36
|
-
a.match_id matchId,
|
|
37
|
-
a.event_times eventTimes,
|
|
38
|
-
a.team_left_id teamLeftId,
|
|
39
|
-
a.team_RIGHt_id teamRightId,
|
|
40
|
-
a.team_left_name teamLeftName,
|
|
41
|
-
a.team_right_name teamRightName,
|
|
42
|
-
a.team_left_image teamLeftImage,
|
|
43
|
-
a.team_right_image teamRightImage,
|
|
44
|
-
<include refid="reportField" />
|
|
45
|
-
<if test="matchInfo.reportType!=null and matchInfo.reportType!=''">
|
|
46
|
-
from view_match_report a
|
|
47
|
-
</if>
|
|
48
|
-
<if test="matchInfo.reportType==null or matchInfo.reportType==''">
|
|
49
|
-
from event_match_report a
|
|
50
|
-
</if>
|
|
51
|
-
left join event_main_info b on a.event_id = b.id
|
|
52
|
-
<where>
|
|
53
|
-
<if test="matchInfo.id!=null and matchInfo.id!=''">
|
|
54
|
-
and a.match_id = #{matchInfo.id}
|
|
55
|
-
</if>
|
|
56
|
-
<if test="matchInfo.eventId!=null and matchInfo.eventId!=''">
|
|
57
|
-
and a.event_id = #{matchInfo.eventId}
|
|
58
|
-
</if>
|
|
59
|
-
<if test="matchInfo.teamLeftId!=null and matchInfo.teamLeftId!=''">
|
|
60
|
-
and (a.team_left_id = #{matchInfo.teamLeftId} OR a.team_right_id = #{matchInfo.teamLeftId})
|
|
61
|
-
</if>
|
|
62
|
-
<if test="dataIdList!=null">
|
|
63
|
-
and a.event_id in
|
|
64
|
-
<foreach collection="dataIdList" item="item" open="(" close=")" separator=",">
|
|
65
|
-
#{item}
|
|
66
|
-
</foreach>
|
|
67
|
-
</if>
|
|
68
|
-
</where>
|
|
69
|
-
</select>
|
|
2
|
+
console.log((HTML.parse(`
|
|
3
|
+
<sql id="reportField">
|
|
4
|
+
a.left_e_foul leftEFoul,
|
|
5
|
+
a.right_e_foul rightEFoul,
|
|
6
|
+
a.left_em_foul leftEmFoul,
|
|
7
|
+
a.right_em_foul rightEmFoul,
|
|
8
|
+
a.left_s_foul leftSFoul,
|
|
9
|
+
a.right_s_foul rightSFoul,
|
|
10
|
+
a.left_sb_foul leftSbFoul,
|
|
11
|
+
a.right_sb_foul rightSbFoul,
|
|
12
|
+
a.left_p_foul leftPFoul,
|
|
13
|
+
a.right_p_foul rightPFoul,
|
|
14
|
+
a.left_attack_goal leftAttackGoal,
|
|
15
|
+
a.right_attack_goal rightAttackGoal,
|
|
16
|
+
a.left_point_goal leftPointGoal,
|
|
17
|
+
a.right_point_goal rightPointGoal,
|
|
18
|
+
a.left_over_time_goal leftOverTimeGoal,
|
|
19
|
+
a.right_over_time_goal rightOverTimeGoal,
|
|
20
|
+
a.left_normal_goal leftNormalGoal,
|
|
21
|
+
a.right_normal_goal rightNormalGoal,
|
|
22
|
+
a.left_own_goal leftOwnGoal,
|
|
23
|
+
a.right_own_goal rightOwnGoal,
|
|
24
|
+
a.left_time_out leftTimeOut,
|
|
25
|
+
a.right_time_out rightTimeOut,
|
|
26
|
+
a.left_coach_y_card leftCoachYCard,
|
|
27
|
+
a.right_coach_y_card rightCoachYCard,
|
|
28
|
+
a.left_player_r_card leftPlayerRCard,
|
|
29
|
+
a.right_player_r_card rightPlayerRCard,
|
|
30
|
+
a.left_jump_ball leftJumpBall,
|
|
31
|
+
a.right_jump_ball rightJumpBall
|
|
32
|
+
</sql>
|
|
33
|
+
<select id="matchReport" resultType="org.jeecg.modules.event.entity.EventMatchReport">
|
|
34
|
+
select
|
|
35
|
+
b.event_name eventName,
|
|
36
|
+
a.match_id matchId,
|
|
37
|
+
a.event_times eventTimes,
|
|
38
|
+
a.team_left_id teamLeftId,
|
|
39
|
+
a.team_RIGHt_id teamRightId,
|
|
40
|
+
a.team_left_name teamLeftName,
|
|
41
|
+
a.team_right_name teamRightName,
|
|
42
|
+
a.team_left_image teamLeftImage,
|
|
43
|
+
a.team_right_image teamRightImage,
|
|
44
|
+
<include refid="reportField" />
|
|
45
|
+
<if test="matchInfo.reportType!=null and matchInfo.reportType!=''">
|
|
46
|
+
from view_match_report a
|
|
47
|
+
</if>
|
|
48
|
+
<if test="matchInfo.reportType==null or matchInfo.reportType==''">
|
|
49
|
+
from event_match_report a
|
|
50
|
+
</if>
|
|
51
|
+
left join event_main_info b on a.event_id = b.id
|
|
52
|
+
<where>
|
|
53
|
+
<if test="matchInfo.id!=null and matchInfo.id!=''">
|
|
54
|
+
and a.match_id = #{matchInfo.id}
|
|
55
|
+
</if>
|
|
56
|
+
<if test="matchInfo.eventId!=null and matchInfo.eventId!=''">
|
|
57
|
+
and a.event_id = #{matchInfo.eventId}
|
|
58
|
+
</if>
|
|
59
|
+
<if test="matchInfo.teamLeftId!=null and matchInfo.teamLeftId!=''">
|
|
60
|
+
and (a.team_left_id = #{matchInfo.teamLeftId} OR a.team_right_id = #{matchInfo.teamLeftId})
|
|
61
|
+
</if>
|
|
62
|
+
<if test="dataIdList!=null">
|
|
63
|
+
and a.event_id in
|
|
64
|
+
<foreach collection="dataIdList" item="item" open="(" close=")" separator=",">
|
|
65
|
+
#{item}
|
|
66
|
+
</foreach>
|
|
67
|
+
</if>
|
|
68
|
+
</where>
|
|
69
|
+
</select>
|
|
70
70
|
>`)));
|
package/wx/base.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
|
+
import pino from 'pino';
|
|
2
3
|
import * as rp from 'request-promise';
|
|
3
4
|
import { Throw } from '../error.js';
|
|
4
|
-
import pino from 'pino';
|
|
5
5
|
const logger = process.env['NODE_ENV'] !== 'production' ? pino({
|
|
6
6
|
name: 'wx',
|
|
7
7
|
transport: {
|