oak-domain 5.1.30 → 5.1.31
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/lib/compiler/dependencyBuilder.js +2 -3
- package/lib/compiler/localeBuilder.d.ts +0 -1
- package/lib/compiler/routerBuilder.js +1 -2
- package/lib/compiler/schemalBuilder.js +12 -12
- package/lib/store/AsyncRowStore.d.ts +0 -1
- package/lib/store/CascadeStore.d.ts +1 -1
- package/lib/store/CascadeStore.js +2 -2
- package/lib/store/IntrinsicCheckers.js +1 -2
- package/lib/store/IntrinsicLogics.js +1 -2
- package/lib/store/RelationAuth.js +2 -2
- package/lib/store/checker.js +4 -5
- package/lib/store/filter.js +12 -13
- package/lib/store/modi.js +5 -6
- package/lib/store/relation.js +1 -2
- package/lib/timers/oper.js +1 -2
- package/lib/timers/vaccum.js +1 -2
- package/lib/types/AppLoader.d.ts +0 -1
- package/lib/types/Connector.d.ts +0 -1
- package/lib/types/Demand.js +2 -2
- package/lib/types/Endpoint.d.ts +0 -1
- package/lib/types/Exception.js +2 -2
- package/lib/types/Expression.js +12 -13
- package/lib/types/Timer.d.ts +1 -0
- package/lib/utils/SimpleConnector.d.ts +2 -3
- package/lib/utils/assert.d.ts +0 -1
- package/lib/utils/date.js +1 -2
- package/lib/utils/domain.js +1 -2
- package/lib/utils/executor.js +1 -2
- package/lib/utils/geo.js +5 -6
- package/lib/utils/lodash.js +3 -3
- package/lib/utils/module/combine.common.js +1 -1
- package/lib/utils/module/combine.dev.d.ts +1 -1
- package/lib/utils/module/combine.dev.js +1 -1
- package/lib/utils/module/combine.prod.js +1 -1
- package/lib/utils/module/combine.server.d.ts +1 -1
- package/lib/utils/module/combine.server.js +1 -1
- package/lib/utils/operationResult.js +1 -2
- package/lib/utils/projection.js +2 -3
- package/lib/utils/random/random.js +1 -2
- package/lib/utils/random/random.mp.d.ts +1 -1
- package/lib/utils/random/random.mp.js +1 -2
- package/lib/utils/random/random.native.d.ts +1 -1
- package/lib/utils/random/random.native.js +1 -2
- package/lib/utils/random/random.web.d.ts +1 -1
- package/lib/utils/random/random.web.js +1 -2
- package/lib/utils/relationPath.js +3 -4
- package/lib/utils/row.js +2 -3
- package/lib/utils/string.js +4 -4
- package/lib/utils/url/index.d.ts +0 -1
- package/lib/utils/url/index.native.d.ts +4 -3
- package/lib/utils/url/index.web.d.ts +4 -3
- package/lib/utils/url/whatwg-url/lib/URL-impl.d.ts +15 -8
- package/lib/utils/url/whatwg-url/lib/infra.js +4 -5
- package/lib/utils/url/whatwg-url/lib/urlencoded.d.ts +1 -2
- package/lib/utils/url/whatwg-url/lib/utils.d.ts +1 -1
- package/lib/utils/uuid.js +10 -11
- package/lib/utils/validator.js +3 -3
- package/lib/utils/version.js +2 -3
- package/package.json +1 -1
package/lib/utils/domain.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.composeUrl =
|
|
3
|
+
exports.composeUrl = composeUrl;
|
|
4
4
|
function composeUrl(url, params) {
|
|
5
5
|
const urlSp = new URLSearchParams(params);
|
|
6
6
|
if (url.includes('?')) {
|
|
@@ -8,4 +8,3 @@ function composeUrl(url, params) {
|
|
|
8
8
|
}
|
|
9
9
|
return `${url}?${urlSp}`;
|
|
10
10
|
}
|
|
11
|
-
exports.composeUrl = composeUrl;
|
package/lib/utils/executor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pipeline =
|
|
3
|
+
exports.pipeline = pipeline;
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* @param units 各个执行单元,需要流水线执行,可能是同步也可能是异步
|
|
@@ -19,4 +19,3 @@ function pipeline(...units) {
|
|
|
19
19
|
};
|
|
20
20
|
return exec(0);
|
|
21
21
|
}
|
|
22
|
-
exports.pipeline = pipeline;
|
package/lib/utils/geo.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getDistanceBetweenPoints = getDistanceBetweenPoints;
|
|
4
|
+
exports.bd09togcj02 = bd09togcj02;
|
|
5
|
+
exports.gcj02tobd09 = gcj02tobd09;
|
|
6
|
+
exports.wgs84togcj02 = wgs84togcj02;
|
|
7
|
+
exports.gcj02towgs84 = gcj02towgs84;
|
|
4
8
|
/**
|
|
5
9
|
* 计算地球上两点之间的球面距离(单位:cm)
|
|
6
10
|
*/
|
|
@@ -21,7 +25,6 @@ function getDistanceBetweenPoints(lat1, lon1, lat2, lon2) {
|
|
|
21
25
|
const d = R * c;
|
|
22
26
|
return d * 1000;
|
|
23
27
|
}
|
|
24
|
-
exports.getDistanceBetweenPoints = getDistanceBetweenPoints;
|
|
25
28
|
//定义一些常量
|
|
26
29
|
const x_PI = 3.14159265358979324 * 3000.0 / 180.0;
|
|
27
30
|
const PI = 3.1415926535897932384626;
|
|
@@ -71,7 +74,6 @@ function bd09togcj02(coord) {
|
|
|
71
74
|
const gg_lat = z * Math.sin(theta);
|
|
72
75
|
return [gg_lng, gg_lat];
|
|
73
76
|
}
|
|
74
|
-
exports.bd09togcj02 = bd09togcj02;
|
|
75
77
|
;
|
|
76
78
|
/**
|
|
77
79
|
* 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换
|
|
@@ -88,7 +90,6 @@ function gcj02tobd09(coord) {
|
|
|
88
90
|
const bd_lat = z * Math.sin(theta) + 0.006;
|
|
89
91
|
return [bd_lng, bd_lat];
|
|
90
92
|
}
|
|
91
|
-
exports.gcj02tobd09 = gcj02tobd09;
|
|
92
93
|
;
|
|
93
94
|
/**
|
|
94
95
|
* WGS84转GCj02
|
|
@@ -115,7 +116,6 @@ function wgs84togcj02(coord) {
|
|
|
115
116
|
return [mglng, mglat];
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
|
-
exports.wgs84togcj02 = wgs84togcj02;
|
|
119
119
|
;
|
|
120
120
|
/**
|
|
121
121
|
* GCJ02 转换为 WGS84
|
|
@@ -142,5 +142,4 @@ function gcj02towgs84(coord) {
|
|
|
142
142
|
return [lng * 2 - mglng, lat * 2 - mglat];
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
exports.gcj02towgs84 = gcj02towgs84;
|
|
146
145
|
;
|
package/lib/utils/lodash.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pullAll = exports.unionBy = exports.groupBy = exports.differenceBy = exports.difference = exports.union = exports.isEqual = exports.pick = exports.cloneDeep = exports.
|
|
3
|
+
exports.pullAll = exports.unionBy = exports.groupBy = exports.differenceBy = exports.difference = exports.union = exports.isEqual = exports.pick = exports.cloneDeep = exports.mergeWith = exports.merge = exports.omit = exports.intersectionBy = exports.intersection = exports.set = exports.get = exports.uniqBy = exports.uniq = exports.pull = exports.unset = void 0;
|
|
4
|
+
exports.mergeConcatArray = mergeConcatArray;
|
|
5
|
+
exports.mergeConcatMany = mergeConcatMany;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
/**
|
|
6
8
|
* 避免lodash打包体积过大
|
|
@@ -65,11 +67,9 @@ function mergeConcatArray(object, source) {
|
|
|
65
67
|
}
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
|
-
exports.mergeConcatArray = mergeConcatArray;
|
|
69
70
|
function mergeConcatMany(array) {
|
|
70
71
|
if (array.length === 0) {
|
|
71
72
|
return undefined;
|
|
72
73
|
}
|
|
73
74
|
return array.reduce((prev, current) => mergeConcatArray(prev, current));
|
|
74
75
|
}
|
|
75
|
-
exports.mergeConcatMany = mergeConcatMany;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = combineBaseModules;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const lodash_1 = require("../../utils/lodash");
|
|
5
6
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
@@ -24,4 +25,3 @@ function combineBaseModules(...modules) {
|
|
|
24
25
|
common: (0, lodash_1.mergeConcatArray)(prev.common, current.common),
|
|
25
26
|
}));
|
|
26
27
|
}
|
|
27
|
-
exports.default = combineBaseModules;
|
|
@@ -5,7 +5,7 @@ import { EntityDict as BaseEntityDict } from '../../base-app-domain';
|
|
|
5
5
|
import { Aspect, Exportation, Importation, Routine, Timer, Trigger, Watcher } from '../../types';
|
|
6
6
|
export default function combineModuleDev<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>>(...modules: string[]): {
|
|
7
7
|
aspectDict: Record<string, Aspect<ED, Cxt>>;
|
|
8
|
-
data: { [T in keyof ED]?: ED[T]["OpSchema"]
|
|
8
|
+
data: { [T in keyof ED]?: Array<ED[T]["OpSchema"]>; };
|
|
9
9
|
importations: Importation<ED, keyof ED, string, Cxt>;
|
|
10
10
|
exportations: Exportation<ED, keyof ED, string, Cxt>;
|
|
11
11
|
watchers: Watcher<ED, keyof ED, Cxt>[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = combineModuleDev;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const combine_common_1 = tslib_1.__importDefault(require("./combine.common"));
|
|
5
6
|
const lodash_1 = require("../../utils/lodash");
|
|
@@ -52,4 +53,3 @@ function combineModuleDev(...modules) {
|
|
|
52
53
|
...others,
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
exports.default = combineModuleDev;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = combineModuleDev;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const combine_common_1 = tslib_1.__importDefault(require("./combine.common"));
|
|
5
6
|
function combineModuleDev(...modules) {
|
|
6
7
|
return (0, combine_common_1.default)(...modules);
|
|
7
8
|
}
|
|
8
|
-
exports.default = combineModuleDev;
|
|
@@ -5,7 +5,7 @@ import { EntityDict as BaseEntityDict } from '../../base-app-domain';
|
|
|
5
5
|
import { Aspect, Exportation, Importation, Routine, Timer, Trigger, Watcher } from '../../types';
|
|
6
6
|
export default function combineModuleServer<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>>(...modules: string[]): {
|
|
7
7
|
aspectDict: Record<string, Aspect<ED, Cxt>>;
|
|
8
|
-
data: { [T in keyof ED]?: ED[T]["OpSchema"]
|
|
8
|
+
data: { [T in keyof ED]?: Array<ED[T]["OpSchema"]>; };
|
|
9
9
|
importations: Importation<ED, keyof ED, string, Cxt>;
|
|
10
10
|
exportations: Exportation<ED, keyof ED, string, Cxt>;
|
|
11
11
|
watchers: Watcher<ED, keyof ED, Cxt>[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = combineModuleServer;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const combine_common_1 = tslib_1.__importDefault(require("./combine.common"));
|
|
5
6
|
const lodash_1 = require("../../utils/lodash");
|
|
@@ -52,4 +53,3 @@ function combineModuleServer(...modules) {
|
|
|
52
53
|
...others,
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
exports.default = combineModuleServer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeOperationResult =
|
|
3
|
+
exports.mergeOperationResult = mergeOperationResult;
|
|
4
4
|
const lodash_1 = require("../utils/lodash");
|
|
5
5
|
function mergeOperationResult(result, toBeMerged) {
|
|
6
6
|
for (const entity in toBeMerged) {
|
|
@@ -16,4 +16,3 @@ function mergeOperationResult(result, toBeMerged) {
|
|
|
16
16
|
}
|
|
17
17
|
return result;
|
|
18
18
|
}
|
|
19
|
-
exports.mergeOperationResult = mergeOperationResult;
|
package/lib/utils/projection.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeProjection = makeProjection;
|
|
4
|
+
exports.traverseProjection = traverseProjection;
|
|
4
5
|
const Entity_1 = require("../types/Entity");
|
|
5
6
|
const relation_1 = require("../store/relation");
|
|
6
7
|
function makeProjection(entity, schema) {
|
|
@@ -13,7 +14,6 @@ function makeProjection(entity, schema) {
|
|
|
13
14
|
}));
|
|
14
15
|
return projection;
|
|
15
16
|
}
|
|
16
|
-
exports.makeProjection = makeProjection;
|
|
17
17
|
function traverseProjection(entity, schema, projection, callback) {
|
|
18
18
|
const access = (entity2, proj) => {
|
|
19
19
|
callback(entity2, proj);
|
|
@@ -32,4 +32,3 @@ function traverseProjection(entity, schema, projection, callback) {
|
|
|
32
32
|
};
|
|
33
33
|
access(entity, projection);
|
|
34
34
|
}
|
|
35
|
-
exports.traverseProjection = traverseProjection;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRandomValues =
|
|
3
|
+
exports.getRandomValues = getRandomValues;
|
|
4
4
|
const node_crypto_1 = require("node:crypto");
|
|
5
5
|
async function getRandomValues(length) {
|
|
6
6
|
if (length > 65536) {
|
|
@@ -16,4 +16,3 @@ async function getRandomValues(length) {
|
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
exports.getRandomValues = getRandomValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRandomValues(length: number): Promise<Uint8Array
|
|
1
|
+
export declare function getRandomValues(length: number): Promise<Uint8Array<ArrayBuffer>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/// <reference types="wechat-miniprogram" />
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getRandomValues =
|
|
4
|
+
exports.getRandomValues = getRandomValues;
|
|
5
5
|
async function getRandomValues(length) {
|
|
6
6
|
if (length > 65536) {
|
|
7
7
|
throw new Error('Can only request a maximum of 65536 bytes');
|
|
@@ -11,4 +11,3 @@ async function getRandomValues(length) {
|
|
|
11
11
|
});
|
|
12
12
|
return new Uint8Array(randomValues);
|
|
13
13
|
}
|
|
14
|
-
exports.getRandomValues = getRandomValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRandomValues(length: number): Promise<Uint8Array
|
|
1
|
+
export declare function getRandomValues(length: number): Promise<Uint8Array<ArrayBuffer>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRandomValues =
|
|
3
|
+
exports.getRandomValues = getRandomValues;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
6
6
|
async function getRandomValues(length) {
|
|
@@ -11,4 +11,3 @@ async function getRandomValues(length) {
|
|
|
11
11
|
return new Uint8Array(randomValues);
|
|
12
12
|
;
|
|
13
13
|
}
|
|
14
|
-
exports.getRandomValues = getRandomValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getRandomValues(length: number): Promise<Uint8Array
|
|
1
|
+
export declare function getRandomValues(length: number): Promise<Uint8Array<ArrayBuffer>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRandomValues =
|
|
3
|
+
exports.getRandomValues = getRandomValues;
|
|
4
4
|
async function getRandomValues(length) {
|
|
5
5
|
if (length > 65536) {
|
|
6
6
|
throw new Error('Can only request a maximum of 65536 bytes');
|
|
@@ -8,4 +8,3 @@ async function getRandomValues(length) {
|
|
|
8
8
|
const randomValues = window.crypto.getRandomValues(new Uint8Array(length));
|
|
9
9
|
return new Uint8Array(randomValues);
|
|
10
10
|
}
|
|
11
|
-
exports.getRandomValues = getRandomValues;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.destructRelationPath = destructRelationPath;
|
|
4
|
+
exports.destructDirectUserPath = destructDirectUserPath;
|
|
5
|
+
exports.destructDirectPath = destructDirectPath;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
8
|
const relation_1 = require("../store/relation");
|
|
@@ -106,7 +108,6 @@ function destructRelationPath(schema, entity, path, relationFilter, recursive) {
|
|
|
106
108
|
};
|
|
107
109
|
return makeIter(entity, 0);
|
|
108
110
|
}
|
|
109
|
-
exports.destructRelationPath = destructRelationPath;
|
|
110
111
|
/**
|
|
111
112
|
* 根据entity的相对path,找到其根结点以及相应的user对象
|
|
112
113
|
* @param schema
|
|
@@ -131,7 +132,6 @@ function destructDirectUserPath(schema, entity, path) {
|
|
|
131
132
|
}
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
|
-
exports.destructDirectUserPath = destructDirectUserPath;
|
|
135
135
|
/**
|
|
136
136
|
* 根据entity的相对path,找到对应的根结点对象数据行
|
|
137
137
|
* @param schema
|
|
@@ -270,4 +270,3 @@ function destructDirectPath(schema, entity, path) {
|
|
|
270
270
|
};
|
|
271
271
|
return makeIter(entity, 0);
|
|
272
272
|
}
|
|
273
|
-
exports.destructDirectPath = destructDirectPath;
|
package/lib/utils/row.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.compareRow = compareRow;
|
|
4
|
+
exports.compareRows = compareRows;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const lodash_1 = require("./lodash");
|
|
6
7
|
const relation_1 = require("../store/relation");
|
|
@@ -49,7 +50,6 @@ function compareRow(schema, entity, row1, row2) {
|
|
|
49
50
|
}
|
|
50
51
|
return true;
|
|
51
52
|
}
|
|
52
|
-
exports.compareRow = compareRow;
|
|
53
53
|
/**
|
|
54
54
|
* 比较两行数据是否完全相等
|
|
55
55
|
* @param entity
|
|
@@ -72,4 +72,3 @@ function compareRows(schema, entity, rows1, rows2) {
|
|
|
72
72
|
}
|
|
73
73
|
return true;
|
|
74
74
|
}
|
|
75
|
-
exports.compareRows = compareRows;
|
package/lib/utils/string.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.randomPrefixedString = exports.random = exports.template = void 0;
|
|
4
|
+
exports.firstLetterLowerCase = firstLetterLowerCase;
|
|
5
|
+
exports.firstLetterUpperCase = firstLetterUpperCase;
|
|
6
|
+
exports.unescapeUnicode = unescapeUnicode;
|
|
4
7
|
function firstLetterLowerCase(s) {
|
|
5
8
|
return s.slice(0, 1).toLowerCase().concat(s.slice(1));
|
|
6
9
|
}
|
|
7
|
-
exports.firstLetterLowerCase = firstLetterLowerCase;
|
|
8
10
|
function firstLetterUpperCase(s) {
|
|
9
11
|
return s.slice(0, 1).toUpperCase().concat(s.slice(1));
|
|
10
12
|
}
|
|
11
|
-
exports.firstLetterUpperCase = firstLetterUpperCase;
|
|
12
13
|
/**
|
|
13
14
|
* 模板字符串 使用 定义const NotFilled = template`${0}未填写`; 调用NotFilled('姓名') 等于姓名未填写
|
|
14
15
|
* @param strings
|
|
@@ -65,5 +66,4 @@ function unescapeUnicode(str) {
|
|
|
65
66
|
return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16));
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
exports.unescapeUnicode = unescapeUnicode;
|
|
69
69
|
;
|
package/lib/utils/url/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
declare const url: {
|
|
2
|
-
new (url: string | URL, base?: string | URL
|
|
2
|
+
new (url: string | URL, base?: string | URL): URL;
|
|
3
3
|
prototype: URL;
|
|
4
|
-
canParse(url: string | URL, base?: string |
|
|
4
|
+
canParse(url: string | URL, base?: string | URL): boolean;
|
|
5
5
|
createObjectURL(obj: Blob | MediaSource): string;
|
|
6
|
+
parse(url: string | URL, base?: string | URL): URL | null;
|
|
6
7
|
revokeObjectURL(url: string): void;
|
|
7
8
|
};
|
|
8
9
|
declare const urlSearchParams: {
|
|
9
|
-
new (init?: string
|
|
10
|
+
new (init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
|
|
10
11
|
prototype: URLSearchParams;
|
|
11
12
|
};
|
|
12
13
|
export { url, urlSearchParams };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
declare const url: {
|
|
2
|
-
new (url: string | URL, base?: string | URL
|
|
2
|
+
new (url: string | URL, base?: string | URL): URL;
|
|
3
3
|
prototype: URL;
|
|
4
|
-
canParse(url: string | URL, base?: string |
|
|
4
|
+
canParse(url: string | URL, base?: string | URL): boolean;
|
|
5
5
|
createObjectURL(obj: Blob | MediaSource): string;
|
|
6
|
+
parse(url: string | URL, base?: string | URL): URL | null;
|
|
6
7
|
revokeObjectURL(url: string): void;
|
|
7
8
|
};
|
|
8
9
|
declare const urlSearchParams: {
|
|
9
|
-
new (init?: string
|
|
10
|
+
new (init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
|
|
10
11
|
prototype: URLSearchParams;
|
|
11
12
|
};
|
|
12
13
|
export { url, urlSearchParams };
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
implementation: {
|
|
3
3
|
new (globalObject: any, constructorArgs: any): {
|
|
4
|
-
href: string;
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
get href(): string;
|
|
5
|
+
set href(v: string);
|
|
6
|
+
get origin(): any;
|
|
7
|
+
get protocol(): string;
|
|
8
|
+
set protocol(v: string);
|
|
7
9
|
username: any;
|
|
8
10
|
password: any;
|
|
9
|
-
host: any;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
get host(): any;
|
|
12
|
+
set host(v: any);
|
|
13
|
+
get hostname(): any;
|
|
14
|
+
set hostname(v: any);
|
|
15
|
+
get port(): string;
|
|
16
|
+
set port(v: string);
|
|
12
17
|
pathname: any;
|
|
13
|
-
search: string;
|
|
18
|
+
get search(): string;
|
|
19
|
+
set search(v: string);
|
|
14
20
|
readonly searchParams: any;
|
|
15
|
-
hash: string;
|
|
21
|
+
get hash(): string;
|
|
22
|
+
set hash(v: string);
|
|
16
23
|
toJSON(): string;
|
|
17
24
|
};
|
|
18
25
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isASCIIDigit = isASCIIDigit;
|
|
4
|
+
exports.isASCIIAlpha = isASCIIAlpha;
|
|
5
|
+
exports.isASCIIAlphanumeric = isASCIIAlphanumeric;
|
|
6
|
+
exports.isASCIIHex = isASCIIHex;
|
|
4
7
|
function isASCIIDigit(c) {
|
|
5
8
|
return c >= 0x30 && c <= 0x39;
|
|
6
9
|
}
|
|
7
|
-
exports.isASCIIDigit = isASCIIDigit;
|
|
8
10
|
function isASCIIAlpha(c) {
|
|
9
11
|
return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);
|
|
10
12
|
}
|
|
11
|
-
exports.isASCIIAlpha = isASCIIAlpha;
|
|
12
13
|
function isASCIIAlphanumeric(c) {
|
|
13
14
|
return isASCIIAlpha(c) || isASCIIDigit(c);
|
|
14
15
|
}
|
|
15
|
-
exports.isASCIIAlphanumeric = isASCIIAlphanumeric;
|
|
16
16
|
function isASCIIHex(c) {
|
|
17
17
|
return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);
|
|
18
18
|
}
|
|
19
|
-
exports.isASCIIHex = isASCIIHex;
|
|
20
19
|
exports.default = {
|
|
21
20
|
isASCIIDigit,
|
|
22
21
|
isASCIIAlpha,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Buffer } from 'buffer';
|
|
3
2
|
declare function percentEncode(c: number): string;
|
|
4
|
-
declare function percentDecode(input: Buffer): Buffer
|
|
3
|
+
declare function percentDecode(input: Buffer): Buffer<ArrayBuffer>;
|
|
5
4
|
declare function serializeUrlencoded(tuples: any[], encodingOverride?: undefined): string;
|
|
6
5
|
declare function parseUrlencoded(input: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>): string[][];
|
|
7
6
|
declare function ucs2decode(string: string): number[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare function isObject(value: null):
|
|
1
|
+
declare function isObject(value: null): value is never;
|
|
2
2
|
declare function hasOwn(obj: any, prop: PropertyKey): boolean;
|
|
3
3
|
declare function getSameObject(wrapper: any, prop: string, creator: () => any): any;
|
|
4
4
|
declare function wrapperForImpl(impl: any): any;
|
package/lib/utils/uuid.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.sequentialUuid = sequentialUuid;
|
|
4
|
+
exports.shrinkUuidTo32Bytes = shrinkUuidTo32Bytes;
|
|
5
|
+
exports.expandUuidTo36Bytes = expandUuidTo36Bytes;
|
|
6
|
+
exports.generateNewIdAsync = generateNewIdAsync;
|
|
7
|
+
exports.produceIds = produceIds;
|
|
8
|
+
exports.setGenerateIdOption = setGenerateIdOption;
|
|
9
|
+
exports.generateNewId = generateNewId;
|
|
10
|
+
exports.formUuid = formUuid;
|
|
11
|
+
exports.compressTo32 = compressTo32;
|
|
12
|
+
exports.decompressFrom32 = decompressFrom32;
|
|
4
13
|
// import { v4 } from 'uuid';
|
|
5
14
|
const random_1 = require("./random/random");
|
|
6
15
|
let _nodeId;
|
|
@@ -100,15 +109,12 @@ function sequentialUuid({ random }) {
|
|
|
100
109
|
}
|
|
101
110
|
return unsafeStringify(b);
|
|
102
111
|
}
|
|
103
|
-
exports.sequentialUuid = sequentialUuid;
|
|
104
112
|
function shrinkUuidTo32Bytes(uuid) {
|
|
105
113
|
return uuid.replace(/\-/g, '');
|
|
106
114
|
}
|
|
107
|
-
exports.shrinkUuidTo32Bytes = shrinkUuidTo32Bytes;
|
|
108
115
|
function expandUuidTo36Bytes(uuidShrinked) {
|
|
109
116
|
return `${uuidShrinked.slice(0, 8)}-${uuidShrinked.slice(8, 12)}-${uuidShrinked.slice(12, 16)}-${uuidShrinked.slice(16, 20)}-${uuidShrinked.slice(20)}`;
|
|
110
117
|
}
|
|
111
|
-
exports.expandUuidTo36Bytes = expandUuidTo36Bytes;
|
|
112
118
|
// 直接生成uuid的接口,为了适配各种环境,写成异步
|
|
113
119
|
async function generateNewIdAsync(option) {
|
|
114
120
|
const option2 = option || ID_OPTION;
|
|
@@ -117,7 +123,6 @@ async function generateNewIdAsync(option) {
|
|
|
117
123
|
} */
|
|
118
124
|
return sequentialUuid({ random: await (0, random_1.getRandomValues)(16) });
|
|
119
125
|
}
|
|
120
|
-
exports.generateNewIdAsync = generateNewIdAsync;
|
|
121
126
|
// 实现同步的id缓存接口,以便于前台使用
|
|
122
127
|
const ID_BUFFER = [];
|
|
123
128
|
let ID_OPTION = {};
|
|
@@ -127,14 +132,12 @@ async function produceIds() {
|
|
|
127
132
|
ID_BUFFER.push(await generateNewIdAsync());
|
|
128
133
|
}
|
|
129
134
|
}
|
|
130
|
-
exports.produceIds = produceIds;
|
|
131
135
|
produceIds();
|
|
132
136
|
function setGenerateIdOption(option) {
|
|
133
137
|
ID_OPTION = option;
|
|
134
138
|
ID_BUFFER.splice(0, ID_BUFFER.length);
|
|
135
139
|
return produceIds();
|
|
136
140
|
}
|
|
137
|
-
exports.setGenerateIdOption = setGenerateIdOption;
|
|
138
141
|
function generateNewId() {
|
|
139
142
|
if (ID_BUFFER.length > 0) {
|
|
140
143
|
const id = ID_BUFFER.pop();
|
|
@@ -156,7 +159,6 @@ function generateNewId() {
|
|
|
156
159
|
return sequentialUuid({ random });
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
|
-
exports.generateNewId = generateNewId;
|
|
160
162
|
function stringToArrayBuffer(str) {
|
|
161
163
|
var bytes = new Array();
|
|
162
164
|
var len, c;
|
|
@@ -215,11 +217,9 @@ function formUuid(...input) {
|
|
|
215
217
|
} while (i < 16);
|
|
216
218
|
return unsafeStringify(b);
|
|
217
219
|
}
|
|
218
|
-
exports.formUuid = formUuid;
|
|
219
220
|
function compressTo32(uuid) {
|
|
220
221
|
return uuid.replace(/-/g, '');
|
|
221
222
|
}
|
|
222
|
-
exports.compressTo32 = compressTo32;
|
|
223
223
|
function decompressFrom32(compressed) {
|
|
224
224
|
return [
|
|
225
225
|
compressed.slice(0, 8),
|
|
@@ -229,4 +229,3 @@ function decompressFrom32(compressed) {
|
|
|
229
229
|
compressed.slice(20)
|
|
230
230
|
].join('-');
|
|
231
231
|
}
|
|
232
|
-
exports.decompressFrom32 = decompressFrom32;
|
package/lib/utils/validator.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isDomain = exports.isIP = exports.isIPV6 = exports.isIPV4 = exports.
|
|
6
|
+
exports.isDomain = exports.isIP = exports.isIPV6 = exports.isIPV4 = exports.isEmail = exports.isVehicleNumber = exports.isMoney = exports.isNumber = exports.isTel = exports.isPhone = exports.isDigital = exports.isSizedCaptcha = exports.isNickname = exports.isUrl = exports.isSoldierNumber = exports.isBirthNumber = exports.isTwCardNumber = exports.isAmCardNumber = exports.isHkCardNumber = exports.isPassportNumber = exports.isIdCardNumber = exports.isCaptcha = exports.isPassword = exports.isMobile = void 0;
|
|
7
|
+
exports.checkAttributesNotNull = checkAttributesNotNull;
|
|
8
|
+
exports.checkAttributesScope = checkAttributesScope;
|
|
7
9
|
const types_1 = require("../types");
|
|
8
10
|
const isMobile = (text) => {
|
|
9
11
|
return ((text) && (typeof text === "string") && ((/^1[3|4|5|6|7|8|9]\d{9}$/.test(text))));
|
|
@@ -122,7 +124,6 @@ function checkAttributesNotNull(entity, data, attributes, allowEmpty) {
|
|
|
122
124
|
throw new types_1.OakAttrNotNullException(entity, attrs, 'error::attributesNull');
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
exports.checkAttributesNotNull = checkAttributesNotNull;
|
|
126
127
|
;
|
|
127
128
|
function checkAttributesScope(entity, data, attributes) {
|
|
128
129
|
const attrs = attributes.filter(attr => !data.hasOwnProperty(attr));
|
|
@@ -130,7 +131,6 @@ function checkAttributesScope(entity, data, attributes) {
|
|
|
130
131
|
throw new types_1.OakInputIllegalException(entity, attrs, 'error::attributesCantUpdate');
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
|
-
exports.checkAttributesScope = checkAttributesScope;
|
|
134
134
|
const isIPV4 = (ip) => {
|
|
135
135
|
// IPv4正则
|
|
136
136
|
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
package/lib/utils/version.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.compareVersion = compareVersion;
|
|
4
|
+
exports.isVersion = isVersion;
|
|
4
5
|
/**
|
|
5
6
|
* 版本比较
|
|
6
7
|
* @param curVersion 当前版本
|
|
@@ -18,7 +19,6 @@ function compareVersion(curVersion, reqVersion) {
|
|
|
18
19
|
}
|
|
19
20
|
return 0;
|
|
20
21
|
}
|
|
21
|
-
exports.compareVersion = compareVersion;
|
|
22
22
|
;
|
|
23
23
|
/**
|
|
24
24
|
* 是不是一个有效的版本号
|
|
@@ -28,4 +28,3 @@ exports.compareVersion = compareVersion;
|
|
|
28
28
|
function isVersion(version) {
|
|
29
29
|
return /([1-9][0-9]*|[0-9])\.([1-9][0-9]*|[0-9])*\.([1-9][0-9]*|[0-9])*(\-[0-9A-Za-z-](\.[0-9A-Za-z-])*)*/g.test(version);
|
|
30
30
|
}
|
|
31
|
-
exports.isVersion = isVersion;
|