@maiyunnet/kebab 7.0.0 → 7.0.2
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/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +3 -3
- package/sys/mod.d.ts +1 -1
- package/sys/mod.js +9 -11
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '7.0.
|
|
9
|
+
export const VER = '7.0.2';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maiyunnet/kebab",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"#kebab/*": "./*"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/client-s3": "^3.
|
|
26
|
-
"@aws-sdk/lib-storage": "^3.
|
|
25
|
+
"@aws-sdk/client-s3": "^3.943.0",
|
|
26
|
+
"@aws-sdk/lib-storage": "^3.943.0",
|
|
27
27
|
"@litert/http-client": "^1.1.2",
|
|
28
28
|
"@litert/mime": "^0.1.3",
|
|
29
29
|
"@litert/redis": "^3.1.0",
|
package/sys/mod.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export default class Mod {
|
|
|
41
41
|
/** --- 若使用 _$key 并且有多个 unique 索引,这里指定 _$key 的索引名 --- */
|
|
42
42
|
protected static _$index: string;
|
|
43
43
|
/** --- 前缀,顺序:选项前缀 -> 本前缀 -> 配置文件前缀 --- */
|
|
44
|
-
protected static _$pre
|
|
44
|
+
protected static _$pre?: string;
|
|
45
45
|
/** --- 要 update 的内容 --- */
|
|
46
46
|
protected _updates: Record<string, boolean>;
|
|
47
47
|
/** --- 模型获取的属性 --- */
|
package/sys/mod.js
CHANGED
|
@@ -53,8 +53,6 @@ export default class Mod {
|
|
|
53
53
|
static { this._$key = ''; }
|
|
54
54
|
/** --- 若使用 _$key 并且有多个 unique 索引,这里指定 _$key 的索引名 --- */
|
|
55
55
|
static { this._$index = ''; }
|
|
56
|
-
/** --- 前缀,顺序:选项前缀 -> 本前缀 -> 配置文件前缀 --- */
|
|
57
|
-
static { this._$pre = null; }
|
|
58
56
|
/**
|
|
59
57
|
* --- 构造函数 ---
|
|
60
58
|
* @param opt 选项
|
|
@@ -82,7 +80,7 @@ export default class Mod {
|
|
|
82
80
|
this._sql = lSql.get({
|
|
83
81
|
'service': this._db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
84
82
|
'ctr': opt.ctr,
|
|
85
|
-
'pre': opt.pre,
|
|
83
|
+
'pre': opt.pre ?? this.constructor._$pre,
|
|
86
84
|
});
|
|
87
85
|
if (opt.index) {
|
|
88
86
|
this._index = typeof opt.index === 'string' ? [opt.index] : [...new Set(opt.index)];
|
|
@@ -123,7 +121,7 @@ export default class Mod {
|
|
|
123
121
|
const sq = lSql.get({
|
|
124
122
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
125
123
|
'ctr': opt.ctr,
|
|
126
|
-
'pre': opt.pre,
|
|
124
|
+
'pre': opt.pre ?? this._$pre,
|
|
127
125
|
});
|
|
128
126
|
if (!vs) {
|
|
129
127
|
// --- 单行 ---
|
|
@@ -172,7 +170,7 @@ export default class Mod {
|
|
|
172
170
|
const sq = lSql.get({
|
|
173
171
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
174
172
|
'ctr': opt.ctr,
|
|
175
|
-
'pre': opt.pre,
|
|
173
|
+
'pre': opt.pre ?? this._$pre,
|
|
176
174
|
});
|
|
177
175
|
sq.insert(this._$table + (opt.index ? ('_' + opt.index) : '')).values(cs, vs);
|
|
178
176
|
return sq.format();
|
|
@@ -190,7 +188,7 @@ export default class Mod {
|
|
|
190
188
|
const sq = lSql.get({
|
|
191
189
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
192
190
|
'ctr': opt.ctr,
|
|
193
|
-
'pre': opt.pre,
|
|
191
|
+
'pre': opt.pre ?? this._$pre,
|
|
194
192
|
});
|
|
195
193
|
sq.delete(this._$table + (index ? ('_' + index) : '')).where(where);
|
|
196
194
|
if (opt.by) {
|
|
@@ -220,7 +218,7 @@ export default class Mod {
|
|
|
220
218
|
const sq = lSql.get({
|
|
221
219
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
222
220
|
'ctr': opt.ctr,
|
|
223
|
-
'pre': opt.pre,
|
|
221
|
+
'pre': opt.pre ?? this._$pre,
|
|
224
222
|
});
|
|
225
223
|
sq.delete(this._$table + (opt.index ? ('_' + opt.index) : '')).where(where);
|
|
226
224
|
if (opt.by) {
|
|
@@ -245,7 +243,7 @@ export default class Mod {
|
|
|
245
243
|
const sq = lSql.get({
|
|
246
244
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
247
245
|
'ctr': opt.ctr,
|
|
248
|
-
'pre': opt.pre,
|
|
246
|
+
'pre': opt.pre ?? this._$pre,
|
|
249
247
|
});
|
|
250
248
|
sq.update(this._$table + (index ? ('_' + index) : ''), data).where(where);
|
|
251
249
|
if (opt.by) {
|
|
@@ -276,7 +274,7 @@ export default class Mod {
|
|
|
276
274
|
const sq = lSql.get({
|
|
277
275
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
278
276
|
'ctr': opt.ctr,
|
|
279
|
-
'pre': opt.pre,
|
|
277
|
+
'pre': opt.pre ?? this._$pre,
|
|
280
278
|
});
|
|
281
279
|
sq.update(this._$table + (opt.index ? ('_' + opt.index) : ''), data).where(where);
|
|
282
280
|
if (opt.by) {
|
|
@@ -324,7 +322,7 @@ export default class Mod {
|
|
|
324
322
|
const sq = lSql.get({
|
|
325
323
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
326
324
|
'ctr': opt.ctr,
|
|
327
|
-
'pre': opt.pre,
|
|
325
|
+
'pre': opt.pre ?? this._$pre,
|
|
328
326
|
});
|
|
329
327
|
const updates = {};
|
|
330
328
|
const keys = [];
|
|
@@ -494,7 +492,7 @@ export default class Mod {
|
|
|
494
492
|
const sq = lSql.get({
|
|
495
493
|
'service': db.getService() ?? lDb.ESERVICE.PGSQL,
|
|
496
494
|
'ctr': opt.ctr,
|
|
497
|
-
'pre': opt.pre,
|
|
495
|
+
'pre': opt.pre ?? this._$pre,
|
|
498
496
|
});
|
|
499
497
|
sq.select(this._$primary, this._$table + (opt.index ? ('_' + opt.index) : '')).where(where);
|
|
500
498
|
const r = await db.query(sq.getSql(), sq.getData());
|