@nocobase/plugin-field-sequence 1.8.0-beta.7 → 1.8.0-beta.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/dist/externalVersion.js
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
|
-
"@nocobase/client": "1.8.0-beta.
|
|
12
|
+
"@nocobase/client": "1.8.0-beta.9",
|
|
13
13
|
"@formily/antd-v5": "1.2.3",
|
|
14
14
|
"@formily/core": "2.3.0",
|
|
15
15
|
"@formily/react": "2.3.0",
|
|
16
|
-
"@nocobase/utils": "1.8.0-beta.
|
|
16
|
+
"@nocobase/utils": "1.8.0-beta.9",
|
|
17
17
|
"antd": "5.24.2",
|
|
18
18
|
"react-i18next": "11.18.6",
|
|
19
|
-
"@nocobase/server": "1.8.0-beta.
|
|
20
|
-
"@nocobase/database": "1.8.0-beta.
|
|
19
|
+
"@nocobase/server": "1.8.0-beta.9",
|
|
20
|
+
"@nocobase/database": "1.8.0-beta.9",
|
|
21
21
|
"dayjs": "1.11.13",
|
|
22
22
|
"lodash": "4.17.21"
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2025-06-
|
|
1
|
+
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2025-06-17T23:39:48.909Z"}
|
|
@@ -46,6 +46,24 @@ var import_cron_parser = __toESM(require("cron-parser"));
|
|
|
46
46
|
var import_dayjs = __toESM(require("dayjs"));
|
|
47
47
|
var import_lodash = __toESM(require("lodash"));
|
|
48
48
|
const sequencePatterns = new import_utils.Registry();
|
|
49
|
+
function parseBigInt(str, radix = 10) {
|
|
50
|
+
if (typeof str !== "string") throw new TypeError("Input must be a string");
|
|
51
|
+
if (typeof radix !== "number" || radix < 2 || radix > 36) throw new RangeError("Radix must be between 2 and 36");
|
|
52
|
+
let negative = false;
|
|
53
|
+
if (str.startsWith("-")) {
|
|
54
|
+
negative = true;
|
|
55
|
+
str = str.slice(1);
|
|
56
|
+
}
|
|
57
|
+
const chars = str.toLowerCase();
|
|
58
|
+
const digits = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
59
|
+
let result = 0n;
|
|
60
|
+
for (const ch of chars) {
|
|
61
|
+
const value = BigInt(digits.indexOf(ch));
|
|
62
|
+
if (value < 0n || value >= BigInt(radix)) throw new SyntaxError(`Invalid digit "${ch}" for base ${radix}`);
|
|
63
|
+
result = result * BigInt(radix) + value;
|
|
64
|
+
}
|
|
65
|
+
return negative ? -result : result;
|
|
66
|
+
}
|
|
49
67
|
sequencePatterns.register("string", {
|
|
50
68
|
validate(options) {
|
|
51
69
|
if (!(options == null ? void 0 : options.value)) {
|
|
@@ -93,8 +111,9 @@ sequencePatterns.register("integer", {
|
|
|
93
111
|
});
|
|
94
112
|
let next = start;
|
|
95
113
|
if (lastSeq.get("current") != null) {
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
const bn = BigInt(lastSeq.get("current")) + 1n;
|
|
115
|
+
next = bn > start ? bn : start;
|
|
116
|
+
const max = BigInt(base) ** BigInt(digits) - 1n;
|
|
98
117
|
if (next > max) {
|
|
99
118
|
next = start;
|
|
100
119
|
}
|
|
@@ -151,7 +170,7 @@ sequencePatterns.register("integer", {
|
|
|
151
170
|
lastGeneratedAt: recordTime
|
|
152
171
|
});
|
|
153
172
|
} else {
|
|
154
|
-
if (number > lastSeq.get("current")) {
|
|
173
|
+
if (number > BigInt(lastSeq.get("current"))) {
|
|
155
174
|
lastSeq.set({
|
|
156
175
|
current: number,
|
|
157
176
|
lastGeneratedAt: recordTime
|
|
@@ -196,7 +215,7 @@ sequencePatterns.register("integer", {
|
|
|
196
215
|
},
|
|
197
216
|
transaction
|
|
198
217
|
});
|
|
199
|
-
const current =
|
|
218
|
+
const current = parseBigInt(value, base);
|
|
200
219
|
if (!lastSeq) {
|
|
201
220
|
return SeqRepo.create({
|
|
202
221
|
values: {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "数据表字段:自动编码",
|
|
5
5
|
"description": "Automatically generate codes based on configured rules, supporting combinations of dates, numbers, and text.",
|
|
6
6
|
"description.zh-CN": "根据配置的规则自动生成编码,支持日期、数字、文本的组合。",
|
|
7
|
-
"version": "1.8.0-beta.
|
|
7
|
+
"version": "1.8.0-beta.9",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/field-sequence",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@nocobase/test": "1.x",
|
|
30
30
|
"@nocobase/utils": "1.x"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "a3449d646c72965845f8c52e52fff9dba759c564",
|
|
33
33
|
"keywords": [
|
|
34
34
|
"Collection fields"
|
|
35
35
|
]
|