efront 4.5.4 → 4.5.8
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/#/345/233/275/351/231/205/345/214/226.yml +84 -9
- package/apps/pivot/api.yml +2 -1
- package/apps/pivot/cert/main.xht +38 -18
- package/apps/pivot/cert/orders.xht +6 -26
- package/apps/pivot/cert/update.xht +35 -2
- package/coms/basic/#loader.js +4 -3
- package/coms/basic/YAML.js +1 -1
- package/coms/basic/awaitable.js +6 -2
- package/coms/{zimoli → basic}/data.js +10 -8
- package/coms/basic/data.md +48 -0
- package/coms/basic/data_test.js +12 -0
- package/coms/basic/parseYML.js +13 -6
- package/coms/basic/parseYML_test.js +5 -1
- package/coms/basic/refilm_decode.js +1 -0
- package/coms/compile/Javascript.js +8 -43
- package/coms/compile/common.js +51 -8
- package/coms/compile/patchlist.js +4 -0
- package/coms/compile/patchname.js +4 -0
- package/coms/compile/scanner2.js +2 -2
- package/coms/compile/translate.js +2 -1
- package/coms/compile//347/264/240/351/246/250.js +4 -3
- package/coms/compile//347/264/240/351/246/250_test.js +1 -0
- package/coms/docs/helps.js +1 -1
- package/coms/pivot/acme2.js +103 -19
- package/coms/pivot/pedit.js +7 -9
- package/coms/reptile/alert.js +1 -0
- package/coms/reptile/detectWithExtension.js +2 -1
- package/coms/reptile/localStorage.js +4 -0
- package/coms/reptile/on.js +4 -0
- package/coms/reptile/onmounted.js +1 -0
- package/coms/reptile/sessionStorage.js +1 -0
- package/coms/reptile/window.js +65 -0
- package/coms/zimoli/alert.js +32 -31
- package/coms/zimoli/button.less +8 -1
- package/coms/zimoli/confirm.js +22 -10
- package/coms/zimoli/model.js +28 -14
- package/coms/zimoli/model.less +45 -2
- package/coms/zimoli/selectDate.js +2 -2
- package/coms/zimoli/view.less +1 -2
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +50 -9
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/coms/zimoli/data_test.js +0 -35
- /package/coms/{zimoli → basic}/LoadingArray.js +0 -0
- /package/coms/{zimoli → basic}/fromBase64.js +0 -0
- /package/coms/{zimoli → basic}/toBase64.js +0 -0
|
@@ -27,6 +27,8 @@ const {
|
|
|
27
27
|
setqueue,
|
|
28
28
|
replace,
|
|
29
29
|
skipAssignment,
|
|
30
|
+
insertAfter,
|
|
31
|
+
unshort,
|
|
30
32
|
} = require("./common");
|
|
31
33
|
var straps = `if,in,do,as,of
|
|
32
34
|
var,for,new,try,let,get,set
|
|
@@ -409,42 +411,7 @@ Javascript.prototype.setType = function (o) {
|
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
413
|
};
|
|
412
|
-
|
|
413
|
-
var queue = this || o.queue;
|
|
414
|
-
var index = queue.indexOf(o);
|
|
415
|
-
var os = [].slice.call(arguments, 1);
|
|
416
|
-
queue.splice.apply(queue, [index, 0].concat(os));
|
|
417
|
-
var prev = o && o.prev, next = o;
|
|
418
|
-
var desc = { value: queue, configurable: true, enumerable: false }
|
|
419
|
-
for (var o of os) {
|
|
420
|
-
if (prev) prev.next = o;
|
|
421
|
-
else queue.first = o;
|
|
422
|
-
o.prev = prev;
|
|
423
|
-
Object.defineProperty(o, 'queue', desc);
|
|
424
|
-
prev = o;
|
|
425
|
-
}
|
|
426
|
-
o.next = next;
|
|
427
|
-
if (next) next.prev = o;
|
|
428
|
-
else queue.last = o;
|
|
429
|
-
}
|
|
430
|
-
var insertAfter = function (o) {
|
|
431
|
-
var queue = this || o.queue;
|
|
432
|
-
var index = queue.indexOf(o) + 1;
|
|
433
|
-
var os = [].slice.call(arguments, 1);
|
|
434
|
-
queue.splice.apply(queue, [index, 0].concat(os));
|
|
435
|
-
var prev = o, next = o && o.next;
|
|
436
|
-
var desc = { value: queue, configurable: true, enumerable: false }
|
|
437
|
-
for (var o of os) {
|
|
438
|
-
if (prev) prev.next = o;
|
|
439
|
-
else queue.first = o;
|
|
440
|
-
o.prev = prev;
|
|
441
|
-
Object.defineProperty(o, 'queue', desc);
|
|
442
|
-
prev = o;
|
|
443
|
-
}
|
|
444
|
-
o.next = next;
|
|
445
|
-
if (next) next.prev = o;
|
|
446
|
-
else queue.last = o;
|
|
447
|
-
};
|
|
414
|
+
|
|
448
415
|
var js = new Javascript;
|
|
449
416
|
var scan = function (data) {
|
|
450
417
|
js.lastIndex = 0;
|
|
@@ -506,10 +473,10 @@ var removeQuote = function (o, c, i) {
|
|
|
506
473
|
if (c.next) c.next.prev = cf;
|
|
507
474
|
}
|
|
508
475
|
|
|
509
|
-
Javascript.prototype.detour = function (
|
|
476
|
+
Javascript.prototype.detour = function (body, ie) {
|
|
510
477
|
context = this;
|
|
511
478
|
var envs = rootenvs = Object.create(null);
|
|
512
|
-
detour(
|
|
479
|
+
detour(body.first, ie);
|
|
513
480
|
rootenvs = null;
|
|
514
481
|
context = null;
|
|
515
482
|
return envs;
|
|
@@ -556,7 +523,8 @@ function detour(o, ie) {
|
|
|
556
523
|
var s = getfunc(o, 'arguments').scoped;
|
|
557
524
|
s.used.arguments.push(...s1.used.arguments);
|
|
558
525
|
};
|
|
559
|
-
|
|
526
|
+
replace(o, ...o1);
|
|
527
|
+
o = o1.last;
|
|
560
528
|
continue;
|
|
561
529
|
}
|
|
562
530
|
text = text.replace(/\.([^\.\[\!\=\:]+)/g, (_, a) => ie === undefined || context.strap_reg.test(a) || /#/.test(a) ? `[${strings.recode(a)}]` : _);
|
|
@@ -642,10 +610,7 @@ function detour(o, ie) {
|
|
|
642
610
|
collectProperty(o, text);
|
|
643
611
|
}
|
|
644
612
|
if (o.short) {
|
|
645
|
-
|
|
646
|
-
o.isprop = false;
|
|
647
|
-
o.type = EXPRESS;
|
|
648
|
-
delete o.short;
|
|
613
|
+
unshort(o);
|
|
649
614
|
}
|
|
650
615
|
else {
|
|
651
616
|
o.text = text;
|
package/coms/compile/common.js
CHANGED
|
@@ -471,12 +471,7 @@ var createScoped = function (parsed, wash) {
|
|
|
471
471
|
case STAMP:
|
|
472
472
|
break;
|
|
473
473
|
case PROPERTY:
|
|
474
|
-
if (o.
|
|
475
|
-
if (o.next.type !== STAMP || o.next.text !== ",") break;
|
|
476
|
-
}
|
|
477
|
-
if (o.prev && o.prev.type === STRAP && o.prev.text === 'as') {
|
|
478
|
-
break;
|
|
479
|
-
}
|
|
474
|
+
if (!o.short) break;
|
|
480
475
|
case VALUE:
|
|
481
476
|
if (o.isdigit || /^(null|false|true)$/.test(o.text)) break;
|
|
482
477
|
case EXPRESS:
|
|
@@ -973,7 +968,11 @@ var saveTo = function (used, k, o) {
|
|
|
973
968
|
var mergeTo = function (used, used0) {
|
|
974
969
|
for (var k in used0) {
|
|
975
970
|
var v = used0[k];
|
|
976
|
-
|
|
971
|
+
if (!used[k]) used[k] = [];
|
|
972
|
+
var u = used[k];
|
|
973
|
+
for (var s of v) {
|
|
974
|
+
u.push(s);
|
|
975
|
+
}
|
|
977
976
|
}
|
|
978
977
|
};
|
|
979
978
|
var breakSpace = function (o) {
|
|
@@ -1443,7 +1442,48 @@ var pickSentence = function (o) {
|
|
|
1443
1442
|
} while (h !== e);
|
|
1444
1443
|
return res;
|
|
1445
1444
|
};
|
|
1446
|
-
|
|
1445
|
+
var insertBefore = function (o) {
|
|
1446
|
+
var queue = this || o.queue;
|
|
1447
|
+
var index = queue.indexOf(o);
|
|
1448
|
+
var os = [].slice.call(arguments, 1);
|
|
1449
|
+
queue.splice.apply(queue, [index, 0].concat(os));
|
|
1450
|
+
var prev = o && o.prev, next = o;
|
|
1451
|
+
var desc = { value: queue, configurable: true, enumerable: false }
|
|
1452
|
+
for (var o of os) {
|
|
1453
|
+
if (prev) prev.next = o;
|
|
1454
|
+
else queue.first = o;
|
|
1455
|
+
o.prev = prev;
|
|
1456
|
+
Object.defineProperty(o, 'queue', desc);
|
|
1457
|
+
prev = o;
|
|
1458
|
+
}
|
|
1459
|
+
o.next = next;
|
|
1460
|
+
if (next) next.prev = o;
|
|
1461
|
+
else queue.last = o;
|
|
1462
|
+
}
|
|
1463
|
+
var insertAfter = function (o) {
|
|
1464
|
+
var queue = this || o.queue;
|
|
1465
|
+
var index = queue.indexOf(o) + 1;
|
|
1466
|
+
var os = [].slice.call(arguments, 1);
|
|
1467
|
+
queue.splice.apply(queue, [index, 0].concat(os));
|
|
1468
|
+
var prev = o, next = o && o.next;
|
|
1469
|
+
var desc = { value: queue, configurable: true, enumerable: false }
|
|
1470
|
+
for (var o of os) {
|
|
1471
|
+
if (prev) prev.next = o;
|
|
1472
|
+
else queue.first = o;
|
|
1473
|
+
o.prev = prev;
|
|
1474
|
+
Object.defineProperty(o, 'queue', desc);
|
|
1475
|
+
prev = o;
|
|
1476
|
+
}
|
|
1477
|
+
o.next = next;
|
|
1478
|
+
if (next) next.prev = o;
|
|
1479
|
+
else queue.last = o;
|
|
1480
|
+
};
|
|
1481
|
+
var unshort = function (o) {
|
|
1482
|
+
insertBefore.call(o.queue, o, { text: o.text, short: false, isprop: true, type: PROPERTY }, { text: ':', type: STAMP });
|
|
1483
|
+
o.isprop = false;
|
|
1484
|
+
o.type = EXPRESS;
|
|
1485
|
+
delete o.short;
|
|
1486
|
+
}
|
|
1447
1487
|
module.exports = {
|
|
1448
1488
|
/* 1 */COMMENT,
|
|
1449
1489
|
/* 2 */SPACE,
|
|
@@ -1459,6 +1499,7 @@ module.exports = {
|
|
|
1459
1499
|
/*2048 */ELEMENT,
|
|
1460
1500
|
number_reg,
|
|
1461
1501
|
equal_reg,
|
|
1502
|
+
unshort,
|
|
1462
1503
|
skipAssignment,
|
|
1463
1504
|
getDeclared,
|
|
1464
1505
|
remove,
|
|
@@ -1483,5 +1524,7 @@ module.exports = {
|
|
|
1483
1524
|
skipFunction,
|
|
1484
1525
|
isHalfSentence,
|
|
1485
1526
|
splice,
|
|
1527
|
+
insertAfter,
|
|
1528
|
+
insertBefore,
|
|
1486
1529
|
mergeTo
|
|
1487
1530
|
};
|
package/coms/compile/scanner2.js
CHANGED
|
@@ -156,14 +156,14 @@ class Code extends Array {
|
|
|
156
156
|
// 提前处理属性
|
|
157
157
|
break() {
|
|
158
158
|
this.program.avoidMap = avoidMap;
|
|
159
|
-
var envs = this.program.detour(this
|
|
159
|
+
var envs = this.program.detour(this);
|
|
160
160
|
if (this._scoped) extend(this.envs, envs);
|
|
161
161
|
return this;
|
|
162
162
|
}
|
|
163
163
|
// 绕开低版本ie的异常属性
|
|
164
164
|
detour(ie) {
|
|
165
165
|
this.program.avoidMap = avoidMap;
|
|
166
|
-
var envs = this.program.detour(this
|
|
166
|
+
var envs = this.program.detour(this, ie !== false);
|
|
167
167
|
if (this._scoped) extend(this.envs, envs);
|
|
168
168
|
return this;
|
|
169
169
|
}
|
|
@@ -91,6 +91,7 @@ var ctn = function (tt, t) {
|
|
|
91
91
|
})
|
|
92
92
|
return tn;
|
|
93
93
|
}
|
|
94
|
+
var warningMap = Object.create(null);
|
|
94
95
|
function translate([imap, supports], code) {
|
|
95
96
|
var texts = getI18nPrefixedText(code);
|
|
96
97
|
texts.sort((a, b) => {
|
|
@@ -108,7 +109,7 @@ function translate([imap, supports], code) {
|
|
|
108
109
|
|
|
109
110
|
var imp = imap[tt];
|
|
110
111
|
if (!imp) {
|
|
111
|
-
if (warn !== false) console.warn(`<yellow>${i18n
|
|
112
|
+
if (warn !== false && !warningMap[tt]) warningMap[tt] = true, console.warn(`<yellow>${i18n`翻译缺失:`}</yellow>${tt}`);
|
|
112
113
|
imp = imap[tt] = supports.map(_ => tt);
|
|
113
114
|
}
|
|
114
115
|
if (nodup && imp.length <= 1) nodup = false;
|
|
@@ -536,10 +536,11 @@ function evalscoped(scoped, base = '') {
|
|
|
536
536
|
k = removeSelectorSpace(k);
|
|
537
537
|
if (base && !p.rooted) p.base = fixBase(base, k);
|
|
538
538
|
else p.base = presets.test(k) ? `@{${k}}` : k;
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
var vars = shallowClone(p.vars);
|
|
540
|
+
if (vars) vlist.push(vars);
|
|
541
|
+
initvars(vars);
|
|
541
542
|
var value = evalthis(p);
|
|
542
|
-
if (
|
|
543
|
+
if (vars) vlist.pop();
|
|
543
544
|
if (value.rest.length) rest = rest.concat(value.rest);
|
|
544
545
|
if (value.length) rest.push([p.base, '{', value.join(""), "}"]);
|
|
545
546
|
}
|
|
@@ -73,3 +73,4 @@ assert(素馨(`a{@a:1px;@margin-x:@a+10px;m:-@margin-x}`), `a{m:-11px;}`);
|
|
|
73
73
|
assert(素馨(`@media screen{&.a{b:1}}`,'a'), `@media screen{a.a{b:1;}}`);
|
|
74
74
|
assert(素馨(`@media screen and(max-width:100px){&.a{b:1}}`,'a'), `@media screen and (max-width:100px){a.a{b:1;}}`);
|
|
75
75
|
assert(素馨(`b{:not([resizing], [dragging]) {transition: padding .2s, margin .2s;}}`), `b :not([resizing], [dragging]){transition:padding .2s, margin .2s;}`);
|
|
76
|
+
assert(素馨(`@a(@b){a@b{@w:@b/2;c:@w;}} @a(1); @a(2); @a(3)`),`a1{c:0.5;}\r\na2{c:1;}\r\na3{c:1.5;}`);
|
package/coms/docs/helps.js
CHANGED
package/coms/pivot/acme2.js
CHANGED
|
@@ -155,7 +155,7 @@ var makeKeyPair = async function (modulusLength = 2048) {
|
|
|
155
155
|
public_key = toBase64(new Uint8Array(public_key));
|
|
156
156
|
return [private_key, public_key];
|
|
157
157
|
};
|
|
158
|
-
var subtle =
|
|
158
|
+
var subtle = globalThis.crypto?.subtle;
|
|
159
159
|
var acme2 = new class {
|
|
160
160
|
email = '';
|
|
161
161
|
kid = '';
|
|
@@ -164,6 +164,11 @@ var acme2 = new class {
|
|
|
164
164
|
domain = '';
|
|
165
165
|
termsOfServiceAgreed = false;
|
|
166
166
|
orders = [];
|
|
167
|
+
schadulePeriod = 90
|
|
168
|
+
nextUpdateTime = "";
|
|
169
|
+
lastUpdateTime = '';
|
|
170
|
+
schaduleEnabled = false;
|
|
171
|
+
enabled = !!subtle;
|
|
167
172
|
public_key = '';
|
|
168
173
|
get enabled() {
|
|
169
174
|
return !!subtle;
|
|
@@ -179,22 +184,43 @@ var acme2 = new class {
|
|
|
179
184
|
var unique = [private_key, public_key].join(',');
|
|
180
185
|
await acme2.makeUnique(unique);
|
|
181
186
|
}
|
|
187
|
+
async updateTime(update) {
|
|
188
|
+
if (!acme2.nextUpdateTime || update) {
|
|
189
|
+
if (!acme2.lastUpdateTime || new Date(acme2.lastUpdateTime) + 86400000 + acme2.schadulePeriod * 86400000 < Date.now()) {
|
|
190
|
+
acme2.nextUpdateTime = parseDate(Date.now() + +acme2.schadulePeriod * 86400000);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
acme2.nextUpdateTime = parseDate(new Date(acme2.lastUpdateTime) + +acme2.schadulePeriod * 86400000);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return new Date(acme2.nextUpdateTime);
|
|
197
|
+
}
|
|
182
198
|
async makeUnique(unique) {
|
|
183
199
|
if (!unique) return;
|
|
184
|
-
var
|
|
200
|
+
var acme2 = this;
|
|
185
201
|
var extra;
|
|
186
202
|
[private_key, public_key, extra] = unique.split(',');
|
|
187
203
|
if (extra) {
|
|
188
204
|
extra = JSON.parse(decodeUTF8(fromBase64(extra)));
|
|
189
|
-
|
|
190
|
-
|
|
205
|
+
acme2.email = extra.email;
|
|
206
|
+
acme2.kid = extra.kid;
|
|
191
207
|
if (extra.kid) {
|
|
192
208
|
var account = data.getUrlParamsForApi(accountApi, extra.kid);
|
|
193
|
-
|
|
209
|
+
acme2.aid = account.aid;
|
|
194
210
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
acme2.domain = extra.domain;
|
|
212
|
+
acme2.termsOfServiceAgreed = extra.termsOfServiceAgreed;
|
|
213
|
+
acme2.orders = extra.orders;
|
|
214
|
+
acme2.lastUpdateTime = parseDate(extra.lastUpdateTime);
|
|
215
|
+
acme2.nextUpdateTime = parseDate(extra.nextUpdateTime);
|
|
216
|
+
acme2.schadulePeriod = +extra.schadulePeriod || 80;
|
|
217
|
+
acme2.schaduleEnabled = extra.schaduleEnabled;
|
|
218
|
+
this.updateTime();
|
|
219
|
+
}
|
|
220
|
+
if (!this.enabled) {
|
|
221
|
+
public_key = null;
|
|
222
|
+
private_key = null;
|
|
223
|
+
return;
|
|
198
224
|
}
|
|
199
225
|
try {
|
|
200
226
|
privateKey = await subtle.importKey("pkcs8", new Uint8Array(fromBase64(private_key)), {
|
|
@@ -205,18 +231,21 @@ var acme2 = new class {
|
|
|
205
231
|
name: RSASSA_PKCS1_v1_5,
|
|
206
232
|
hash: "SHA-256",
|
|
207
233
|
}, true, ["verify"]);
|
|
208
|
-
|
|
209
|
-
avme2.public_key = public_key;
|
|
234
|
+
acme2.public_key = public_key;
|
|
210
235
|
} catch (e) { alert("加载服务器公钥异常!", "error"); throw e }
|
|
211
236
|
}
|
|
212
237
|
pickUnique() {
|
|
213
|
-
var
|
|
238
|
+
var acme2 = this;
|
|
214
239
|
var extra = {
|
|
215
|
-
kid:
|
|
216
|
-
email:
|
|
217
|
-
domain:
|
|
218
|
-
orders:
|
|
219
|
-
|
|
240
|
+
kid: acme2.kid,
|
|
241
|
+
email: acme2.email,
|
|
242
|
+
domain: acme2.domain,
|
|
243
|
+
orders: acme2.orders,
|
|
244
|
+
schadulePeriod: acme2.schadulePeriod,
|
|
245
|
+
nextUpdateTime: acme2.nextUpdateTime && +new Date(acme2.nextUpdateTime),
|
|
246
|
+
lastUpdateTime: acme2.lastUpdateTime && +new Date(acme2.lastUpdateTime),
|
|
247
|
+
schaduleEnabled: acme2.schaduleEnabled,
|
|
248
|
+
termsOfServiceAgreed: acme2.termsOfServiceAgreed
|
|
220
249
|
};
|
|
221
250
|
return [private_key, public_key, base64url(extra)].join(",");
|
|
222
251
|
}
|
|
@@ -256,7 +285,7 @@ var acme2 = new class {
|
|
|
256
285
|
var i = this.orders.indexOf(order);
|
|
257
286
|
if (i >= 0) this.orders.splice(i, 1);
|
|
258
287
|
this.orders = [order].concat(this.orders);
|
|
259
|
-
return order;
|
|
288
|
+
return this.parseOrder(order);
|
|
260
289
|
}
|
|
261
290
|
parseOrder(o) {
|
|
262
291
|
if (typeof o !== 'string') return o;
|
|
@@ -268,6 +297,7 @@ var acme2 = new class {
|
|
|
268
297
|
async getOrder(o) {
|
|
269
298
|
var r = await data.fromURL(o.url);
|
|
270
299
|
if (r.expires) r.expires = new Date(r.expires);
|
|
300
|
+
r = extend({}, o, r);
|
|
271
301
|
return r;
|
|
272
302
|
}
|
|
273
303
|
async thumbprint() {
|
|
@@ -284,7 +314,61 @@ var acme2 = new class {
|
|
|
284
314
|
var csr = await createCSR(domains, private_key);
|
|
285
315
|
return toBase64(csr, true);
|
|
286
316
|
}
|
|
287
|
-
async
|
|
288
|
-
|
|
317
|
+
async waitStatus(o) {
|
|
318
|
+
if (!/ing$/i.test(o.status)) return o;
|
|
319
|
+
o = await this.getOrder(o);
|
|
320
|
+
while (/ing$/i.test(o.status)) {
|
|
321
|
+
wait(600);
|
|
322
|
+
o = await this.getOrder(o);
|
|
323
|
+
}
|
|
324
|
+
return o;
|
|
325
|
+
}
|
|
326
|
+
async auditOrder(o, setauth) {
|
|
327
|
+
if (o.status !== 'pending') return o;
|
|
328
|
+
a: for (var a of o.authorizations) {
|
|
329
|
+
var b = await data.fromURL(a);
|
|
330
|
+
if (b.challenges) {
|
|
331
|
+
for (var c of b.challenges) {
|
|
332
|
+
if (c.type === 'http-01') {
|
|
333
|
+
if (c.status !== 'pending') continue a;
|
|
334
|
+
await setauth(`/.well-known/acme-challenge/${c.token}`, c.token + "." + await acme2.thumbprint());
|
|
335
|
+
await acme2.requestURL(c.url, {});
|
|
336
|
+
continue a;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
o = await this.waitStatus(o);
|
|
342
|
+
return o;
|
|
343
|
+
}
|
|
344
|
+
async finalizeOrder(o, upload) {
|
|
345
|
+
if (o.status !== 'ready') return o;
|
|
346
|
+
var domains = o.identifiers.map(d => d.value);
|
|
347
|
+
var kp = await this.createKeyPair();
|
|
348
|
+
var csr = await this.createCSR(domains, kp[0]);
|
|
349
|
+
var order = await this.requestURL(o.finalize, { csr });
|
|
350
|
+
o = extend({}, o, order);
|
|
351
|
+
upload(o, { oid: o.oid, private: kp[0], public: kp[1] });
|
|
352
|
+
return o;
|
|
353
|
+
}
|
|
354
|
+
async autoUpdate(domain, setauth, upload) {
|
|
355
|
+
if (!domain.length) return;
|
|
356
|
+
if (acme2.orders.length >= 20) acme2.orders.pop();
|
|
357
|
+
this.lastUpdateTime = parseDate(Date.now());
|
|
358
|
+
this.updateTime();
|
|
359
|
+
var o = await acme2.newOrder({ domain });
|
|
360
|
+
o = await acme2.getOrder(o);
|
|
361
|
+
if (o.status === 'pending') {
|
|
362
|
+
o = await acme2.auditOrder(o, setauth);
|
|
363
|
+
}
|
|
364
|
+
if (o.status === 'ready') {
|
|
365
|
+
await this.finalizeOrder(o, upload);
|
|
366
|
+
o = await this.waitStatus();
|
|
367
|
+
}
|
|
368
|
+
if (o.status === 'valid') {
|
|
369
|
+
var cert = await data.fromURL(o.certificate);
|
|
370
|
+
upload(o, { cert });
|
|
371
|
+
}
|
|
372
|
+
return o;
|
|
289
373
|
}
|
|
290
374
|
}
|
package/coms/pivot/pedit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function send(type, key, value, origin) {
|
|
2
|
-
return data.from(origin
|
|
2
|
+
return data.from(origin, {
|
|
3
3
|
type,
|
|
4
4
|
key: encode62.timeencode(key),
|
|
5
5
|
value: isHandled(value) ? encode62.timeencode(JSON.stringify(value)) : '',
|
|
@@ -10,21 +10,19 @@ function pedit(title, type, params, idkey = params.fields[0].key) {
|
|
|
10
10
|
return frame$edit(title, {
|
|
11
11
|
submit(a, fields) {
|
|
12
12
|
a = submit(fields, a);
|
|
13
|
-
return send(type, a[idkey], a, pdata);
|
|
13
|
+
return send(type, a[idkey], a, pdata ? "edit" : "add");
|
|
14
14
|
},
|
|
15
15
|
}, params);
|
|
16
16
|
}
|
|
17
17
|
pedit.create = function (type, key, value) {
|
|
18
|
-
return send(type, key, value,
|
|
18
|
+
return send(type, key, value, "add");
|
|
19
19
|
}
|
|
20
20
|
var query = pedit.query = function (type, key) {
|
|
21
|
-
return send(type, key, null,
|
|
21
|
+
return send(type, key, null, "edit");
|
|
22
22
|
}
|
|
23
23
|
var update = pedit.update = function (type, key, value) {
|
|
24
|
-
return send(type, key, value,
|
|
24
|
+
return send(type, key, value, "edit");
|
|
25
25
|
}
|
|
26
|
-
pedit.
|
|
27
|
-
|
|
28
|
-
extendIfNeeded(params, data);
|
|
29
|
-
return update(type, key, params);
|
|
26
|
+
pedit.patch = async function (type, key, params) {
|
|
27
|
+
return send(type, key, params, 'patch');
|
|
30
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a => console.warn(a);
|
|
@@ -2,6 +2,7 @@ var path = require("path");
|
|
|
2
2
|
var fs = require("fs").promises;
|
|
3
3
|
var $split = require("../basic/$split");
|
|
4
4
|
var str2array = require("../basic/str2array");
|
|
5
|
+
var colors = require('./colors');
|
|
5
6
|
async function detectWithExtension(filenames, extensions = [""], folders = [""]) {
|
|
6
7
|
if (typeof filenames === 'string') filenames = str2array(filenames);
|
|
7
8
|
if (typeof extensions === 'string') extensions = str2array(extensions);
|
|
@@ -31,7 +32,7 @@ async function detectWithExtension(filenames, extensions = [""], folders = [""])
|
|
|
31
32
|
if (!findedFolder) findedFolder = f + params;
|
|
32
33
|
} catch { }
|
|
33
34
|
}
|
|
34
|
-
if (!findedFolder) throw new Error(
|
|
35
|
+
if (!findedFolder) throw new Error(`路径${filenames.map(f => colors.FgYellow + f[0] + colors.Reset).join(', ')}不存在`);
|
|
35
36
|
return findedFolder;
|
|
36
37
|
}
|
|
37
38
|
module.exports = detectWithExtension;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function onmounted(target, handler) { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
return globalThis.sessionStorage || { getItem() { }, setItem() { } };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var global1 = typeof globalThis !== 'undefined' ? globalThis : typeof global !== "undefined" ? global : {};
|
|
2
|
+
var extendIfNeeded = require("../basic/extendIfNeeded");
|
|
3
|
+
if (global1.window) {
|
|
4
|
+
module.exports = global1.window;
|
|
5
|
+
}
|
|
6
|
+
else {
|
|
7
|
+
var Window = function () {
|
|
8
|
+
};
|
|
9
|
+
var window = new Window;
|
|
10
|
+
Object.assign(window, {
|
|
11
|
+
Date,
|
|
12
|
+
Promise,
|
|
13
|
+
Function,
|
|
14
|
+
RegExp,
|
|
15
|
+
Object,
|
|
16
|
+
String,
|
|
17
|
+
Array,
|
|
18
|
+
Number,
|
|
19
|
+
Boolean,
|
|
20
|
+
Error,
|
|
21
|
+
TypeError,
|
|
22
|
+
Uint8Array,
|
|
23
|
+
Uint16Array,
|
|
24
|
+
Uint32Array,
|
|
25
|
+
Uint8ClampedArray,
|
|
26
|
+
ArrayBuffer,
|
|
27
|
+
Int8Array,
|
|
28
|
+
Int16Array,
|
|
29
|
+
Int32Array,
|
|
30
|
+
Float32Array,
|
|
31
|
+
Float64Array,
|
|
32
|
+
Map,
|
|
33
|
+
Set,
|
|
34
|
+
Proxy,
|
|
35
|
+
WeakMap,
|
|
36
|
+
Reflect,
|
|
37
|
+
console,
|
|
38
|
+
Math,
|
|
39
|
+
JSON,
|
|
40
|
+
NaN,
|
|
41
|
+
Infinity,
|
|
42
|
+
isNaN,
|
|
43
|
+
isFinite,
|
|
44
|
+
parseInt,
|
|
45
|
+
parseFloat,
|
|
46
|
+
decodeURI,
|
|
47
|
+
encodeURI,
|
|
48
|
+
decodeURIComponent,
|
|
49
|
+
encodeURIComponent,
|
|
50
|
+
document: global1.document,
|
|
51
|
+
navigator: global1.navigator,
|
|
52
|
+
process: global1.process,
|
|
53
|
+
BigInt64Array: global1.BigInt64Array,
|
|
54
|
+
Buffer: global1.Buffer,
|
|
55
|
+
Intl: global1.Intl,
|
|
56
|
+
BigInt: global1.BigInt,
|
|
57
|
+
Symbol: global1.Symbol,
|
|
58
|
+
SharedArrayBuffer: global1.SharedArrayBuffer,
|
|
59
|
+
escape: global1.escape,
|
|
60
|
+
unescape: global1.unescape,
|
|
61
|
+
});
|
|
62
|
+
window.globalThis = window.global = window.top = window.window = window;
|
|
63
|
+
extendIfNeeded(window, global1);
|
|
64
|
+
module.exports = window;
|
|
65
|
+
}
|