hyoo_sync_client 0.0.243 → 0.0.245
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/node.d.ts +4 -7
- package/node.deps.json +1 -1
- package/node.js +28 -28
- package/node.js.map +1 -1
- package/node.mjs +28 -28
- package/node.test.js +28 -28
- package/node.test.js.map +1 -1
- package/package.json +3 -4
- package/web.d.ts +4 -7
- package/web.deps.json +1 -1
- package/web.js +28 -28
- package/web.js.map +1 -1
- package/web.mjs +28 -28
- package/web.test.js.map +1 -1
package/web.mjs
CHANGED
|
@@ -445,16 +445,6 @@ var $;
|
|
|
445
445
|
;
|
|
446
446
|
"use strict";
|
|
447
447
|
var $;
|
|
448
|
-
(function ($) {
|
|
449
|
-
function $mol_base64_encode_safe(buffer) {
|
|
450
|
-
return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/, '');
|
|
451
|
-
}
|
|
452
|
-
$.$mol_base64_encode_safe = $mol_base64_encode_safe;
|
|
453
|
-
})($ || ($ = {}));
|
|
454
|
-
//mol/base64/encode/safe/safe.ts
|
|
455
|
-
;
|
|
456
|
-
"use strict";
|
|
457
|
-
var $;
|
|
458
448
|
(function ($) {
|
|
459
449
|
function $mol_base64_decode(base64) {
|
|
460
450
|
throw new Error('Not implemented');
|
|
@@ -477,12 +467,16 @@ var $;
|
|
|
477
467
|
"use strict";
|
|
478
468
|
var $;
|
|
479
469
|
(function ($) {
|
|
480
|
-
function $
|
|
470
|
+
function $mol_base64_url_encode(buffer) {
|
|
471
|
+
return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
|
|
472
|
+
}
|
|
473
|
+
$.$mol_base64_url_encode = $mol_base64_url_encode;
|
|
474
|
+
function $mol_base64_url_decode(str) {
|
|
481
475
|
return $mol_base64_decode(str.replace(/-/g, '+').replace(/_/g, '/'));
|
|
482
476
|
}
|
|
483
|
-
$.$
|
|
477
|
+
$.$mol_base64_url_decode = $mol_base64_url_decode;
|
|
484
478
|
})($ || ($ = {}));
|
|
485
|
-
//mol/base64/
|
|
479
|
+
//mol/base64/url/url.ts
|
|
486
480
|
;
|
|
487
481
|
"use strict";
|
|
488
482
|
var $;
|
|
@@ -510,8 +504,8 @@ var $;
|
|
|
510
504
|
}
|
|
511
505
|
static async from(serial) {
|
|
512
506
|
if (typeof serial !== 'string') {
|
|
513
|
-
serial = $
|
|
514
|
-
+ $
|
|
507
|
+
serial = $mol_base64_url_encode(serial.subarray(0, 32))
|
|
508
|
+
+ $mol_base64_url_encode(serial.subarray(32, 64));
|
|
515
509
|
}
|
|
516
510
|
return new this(await $mol_crypto_native.subtle.importKey('jwk', {
|
|
517
511
|
crv: "P-256",
|
|
@@ -529,8 +523,8 @@ var $;
|
|
|
529
523
|
async toArray() {
|
|
530
524
|
const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
|
|
531
525
|
return new Uint8Array([
|
|
532
|
-
...$
|
|
533
|
-
...$
|
|
526
|
+
...$mol_base64_url_decode(x),
|
|
527
|
+
...$mol_base64_url_decode(y),
|
|
534
528
|
]);
|
|
535
529
|
}
|
|
536
530
|
async verify(data, sign) {
|
|
@@ -548,9 +542,9 @@ var $;
|
|
|
548
542
|
}
|
|
549
543
|
static async from(serial) {
|
|
550
544
|
if (typeof serial !== 'string') {
|
|
551
|
-
serial = $
|
|
552
|
-
+ $
|
|
553
|
-
+ $
|
|
545
|
+
serial = $mol_base64_url_encode(serial.subarray(0, 32))
|
|
546
|
+
+ $mol_base64_url_encode(serial.subarray(32, 64))
|
|
547
|
+
+ $mol_base64_url_encode(serial.subarray(64));
|
|
554
548
|
}
|
|
555
549
|
return new this(await $mol_crypto_native.subtle.importKey('jwk', {
|
|
556
550
|
crv: "P-256",
|
|
@@ -569,9 +563,9 @@ var $;
|
|
|
569
563
|
async toArray() {
|
|
570
564
|
const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
|
|
571
565
|
return new Uint8Array([
|
|
572
|
-
...$
|
|
573
|
-
...$
|
|
574
|
-
...$
|
|
566
|
+
...$mol_base64_url_decode(x),
|
|
567
|
+
...$mol_base64_url_decode(y),
|
|
568
|
+
...$mol_base64_url_decode(d),
|
|
575
569
|
]);
|
|
576
570
|
}
|
|
577
571
|
async sign(data) {
|
|
@@ -644,7 +638,12 @@ var $;
|
|
|
644
638
|
if (!val)
|
|
645
639
|
return null;
|
|
646
640
|
if ($.$mol_dev_format_head in val) {
|
|
647
|
-
|
|
641
|
+
try {
|
|
642
|
+
return val[$.$mol_dev_format_head]();
|
|
643
|
+
}
|
|
644
|
+
catch (error) {
|
|
645
|
+
return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
|
|
646
|
+
}
|
|
648
647
|
}
|
|
649
648
|
if (typeof val === 'function') {
|
|
650
649
|
return $mol_dev_format_native(val);
|
|
@@ -2811,6 +2810,7 @@ var $;
|
|
|
2811
2810
|
const getter = (() => value);
|
|
2812
2811
|
getter['()'] = value;
|
|
2813
2812
|
getter[Symbol.toStringTag] = value;
|
|
2813
|
+
getter[$mol_dev_format_head] = () => $mol_dev_format_span({}, '()=> ', $mol_dev_format_auto(value));
|
|
2814
2814
|
return getter;
|
|
2815
2815
|
}
|
|
2816
2816
|
$.$mol_const = $mol_const;
|
|
@@ -3184,17 +3184,17 @@ var $;
|
|
|
3184
3184
|
(function ($) {
|
|
3185
3185
|
class $hyoo_crowd_fund extends $mol_object {
|
|
3186
3186
|
world;
|
|
3187
|
-
|
|
3188
|
-
constructor(world,
|
|
3187
|
+
node_class;
|
|
3188
|
+
constructor(world, node_class) {
|
|
3189
3189
|
super();
|
|
3190
3190
|
this.world = world;
|
|
3191
|
-
this.
|
|
3191
|
+
this.node_class = node_class;
|
|
3192
3192
|
}
|
|
3193
3193
|
Item(id) {
|
|
3194
3194
|
const [land, head] = id.split('!');
|
|
3195
3195
|
if (!head)
|
|
3196
3196
|
return this.Item(`${land}!0_0`);
|
|
3197
|
-
return this.world.land_sync(land).node(head, this.
|
|
3197
|
+
return this.world.land_sync(land).node(head, this.node_class);
|
|
3198
3198
|
}
|
|
3199
3199
|
make(law = [''], mod = [], add = []) {
|
|
3200
3200
|
const land = $mol_wire_sync(this.world).grab(law, mod, add);
|