hyoo_sync_client 0.0.244 → 0.0.246
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 +27 -28
- package/node.js.map +1 -1
- package/node.mjs +27 -28
- package/node.test.js +27 -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 +27 -28
- package/web.js.map +1 -1
- package/web.mjs +27 -28
- package/web.test.js.map +1 -1
package/node.mjs
CHANGED
|
@@ -1021,16 +1021,6 @@ var $;
|
|
|
1021
1021
|
;
|
|
1022
1022
|
"use strict";
|
|
1023
1023
|
var $;
|
|
1024
|
-
(function ($) {
|
|
1025
|
-
function $mol_base64_encode_safe(buffer) {
|
|
1026
|
-
return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/, '');
|
|
1027
|
-
}
|
|
1028
|
-
$.$mol_base64_encode_safe = $mol_base64_encode_safe;
|
|
1029
|
-
})($ || ($ = {}));
|
|
1030
|
-
//mol/base64/encode/safe/safe.ts
|
|
1031
|
-
;
|
|
1032
|
-
"use strict";
|
|
1033
|
-
var $;
|
|
1034
1024
|
(function ($) {
|
|
1035
1025
|
function $mol_base64_decode(base64) {
|
|
1036
1026
|
throw new Error('Not implemented');
|
|
@@ -1055,12 +1045,16 @@ var $;
|
|
|
1055
1045
|
"use strict";
|
|
1056
1046
|
var $;
|
|
1057
1047
|
(function ($) {
|
|
1058
|
-
function $
|
|
1048
|
+
function $mol_base64_url_encode(buffer) {
|
|
1049
|
+
return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
|
|
1050
|
+
}
|
|
1051
|
+
$.$mol_base64_url_encode = $mol_base64_url_encode;
|
|
1052
|
+
function $mol_base64_url_decode(str) {
|
|
1059
1053
|
return $mol_base64_decode(str.replace(/-/g, '+').replace(/_/g, '/'));
|
|
1060
1054
|
}
|
|
1061
|
-
$.$
|
|
1055
|
+
$.$mol_base64_url_decode = $mol_base64_url_decode;
|
|
1062
1056
|
})($ || ($ = {}));
|
|
1063
|
-
//mol/base64/
|
|
1057
|
+
//mol/base64/url/url.ts
|
|
1064
1058
|
;
|
|
1065
1059
|
"use strict";
|
|
1066
1060
|
var $;
|
|
@@ -1088,8 +1082,8 @@ var $;
|
|
|
1088
1082
|
}
|
|
1089
1083
|
static async from(serial) {
|
|
1090
1084
|
if (typeof serial !== 'string') {
|
|
1091
|
-
serial = $
|
|
1092
|
-
+ $
|
|
1085
|
+
serial = $mol_base64_url_encode(serial.subarray(0, 32))
|
|
1086
|
+
+ $mol_base64_url_encode(serial.subarray(32, 64));
|
|
1093
1087
|
}
|
|
1094
1088
|
return new this(await $mol_crypto_native.subtle.importKey('jwk', {
|
|
1095
1089
|
crv: "P-256",
|
|
@@ -1107,8 +1101,8 @@ var $;
|
|
|
1107
1101
|
async toArray() {
|
|
1108
1102
|
const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
|
|
1109
1103
|
return new Uint8Array([
|
|
1110
|
-
...$
|
|
1111
|
-
...$
|
|
1104
|
+
...$mol_base64_url_decode(x),
|
|
1105
|
+
...$mol_base64_url_decode(y),
|
|
1112
1106
|
]);
|
|
1113
1107
|
}
|
|
1114
1108
|
async verify(data, sign) {
|
|
@@ -1126,9 +1120,9 @@ var $;
|
|
|
1126
1120
|
}
|
|
1127
1121
|
static async from(serial) {
|
|
1128
1122
|
if (typeof serial !== 'string') {
|
|
1129
|
-
serial = $
|
|
1130
|
-
+ $
|
|
1131
|
-
+ $
|
|
1123
|
+
serial = $mol_base64_url_encode(serial.subarray(0, 32))
|
|
1124
|
+
+ $mol_base64_url_encode(serial.subarray(32, 64))
|
|
1125
|
+
+ $mol_base64_url_encode(serial.subarray(64));
|
|
1132
1126
|
}
|
|
1133
1127
|
return new this(await $mol_crypto_native.subtle.importKey('jwk', {
|
|
1134
1128
|
crv: "P-256",
|
|
@@ -1147,9 +1141,9 @@ var $;
|
|
|
1147
1141
|
async toArray() {
|
|
1148
1142
|
const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
|
|
1149
1143
|
return new Uint8Array([
|
|
1150
|
-
...$
|
|
1151
|
-
...$
|
|
1152
|
-
...$
|
|
1144
|
+
...$mol_base64_url_decode(x),
|
|
1145
|
+
...$mol_base64_url_decode(y),
|
|
1146
|
+
...$mol_base64_url_decode(d),
|
|
1153
1147
|
]);
|
|
1154
1148
|
}
|
|
1155
1149
|
async sign(data) {
|
|
@@ -1222,7 +1216,12 @@ var $;
|
|
|
1222
1216
|
if (!val)
|
|
1223
1217
|
return null;
|
|
1224
1218
|
if ($.$mol_dev_format_head in val) {
|
|
1225
|
-
|
|
1219
|
+
try {
|
|
1220
|
+
return val[$.$mol_dev_format_head]();
|
|
1221
|
+
}
|
|
1222
|
+
catch (error) {
|
|
1223
|
+
return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
|
|
1224
|
+
}
|
|
1226
1225
|
}
|
|
1227
1226
|
if (typeof val === 'function') {
|
|
1228
1227
|
return $mol_dev_format_native(val);
|
|
@@ -3449,17 +3448,17 @@ var $;
|
|
|
3449
3448
|
(function ($) {
|
|
3450
3449
|
class $hyoo_crowd_fund extends $mol_object {
|
|
3451
3450
|
world;
|
|
3452
|
-
|
|
3453
|
-
constructor(world,
|
|
3451
|
+
node_class;
|
|
3452
|
+
constructor(world, node_class) {
|
|
3454
3453
|
super();
|
|
3455
3454
|
this.world = world;
|
|
3456
|
-
this.
|
|
3455
|
+
this.node_class = node_class;
|
|
3457
3456
|
}
|
|
3458
3457
|
Item(id) {
|
|
3459
3458
|
const [land, head] = id.split('!');
|
|
3460
3459
|
if (!head)
|
|
3461
3460
|
return this.Item(`${land}!0_0`);
|
|
3462
|
-
return this.world.land_sync(land).node(head, this.
|
|
3461
|
+
return this.world.land_sync(land).node(head, this.node_class);
|
|
3463
3462
|
}
|
|
3464
3463
|
make(law = [''], mod = [], add = []) {
|
|
3465
3464
|
const land = $mol_wire_sync(this.world).grab(law, mod, add);
|
package/node.test.js
CHANGED
|
@@ -1013,16 +1013,6 @@ var $;
|
|
|
1013
1013
|
;
|
|
1014
1014
|
"use strict";
|
|
1015
1015
|
var $;
|
|
1016
|
-
(function ($) {
|
|
1017
|
-
function $mol_base64_encode_safe(buffer) {
|
|
1018
|
-
return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/, '');
|
|
1019
|
-
}
|
|
1020
|
-
$.$mol_base64_encode_safe = $mol_base64_encode_safe;
|
|
1021
|
-
})($ || ($ = {}));
|
|
1022
|
-
//mol/base64/encode/safe/safe.ts
|
|
1023
|
-
;
|
|
1024
|
-
"use strict";
|
|
1025
|
-
var $;
|
|
1026
1016
|
(function ($) {
|
|
1027
1017
|
function $mol_base64_decode(base64) {
|
|
1028
1018
|
throw new Error('Not implemented');
|
|
@@ -1047,12 +1037,16 @@ var $;
|
|
|
1047
1037
|
"use strict";
|
|
1048
1038
|
var $;
|
|
1049
1039
|
(function ($) {
|
|
1050
|
-
function $
|
|
1040
|
+
function $mol_base64_url_encode(buffer) {
|
|
1041
|
+
return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
|
|
1042
|
+
}
|
|
1043
|
+
$.$mol_base64_url_encode = $mol_base64_url_encode;
|
|
1044
|
+
function $mol_base64_url_decode(str) {
|
|
1051
1045
|
return $mol_base64_decode(str.replace(/-/g, '+').replace(/_/g, '/'));
|
|
1052
1046
|
}
|
|
1053
|
-
$.$
|
|
1047
|
+
$.$mol_base64_url_decode = $mol_base64_url_decode;
|
|
1054
1048
|
})($ || ($ = {}));
|
|
1055
|
-
//mol/base64/
|
|
1049
|
+
//mol/base64/url/url.ts
|
|
1056
1050
|
;
|
|
1057
1051
|
"use strict";
|
|
1058
1052
|
var $;
|
|
@@ -1080,8 +1074,8 @@ var $;
|
|
|
1080
1074
|
}
|
|
1081
1075
|
static async from(serial) {
|
|
1082
1076
|
if (typeof serial !== 'string') {
|
|
1083
|
-
serial = $
|
|
1084
|
-
+ $
|
|
1077
|
+
serial = $mol_base64_url_encode(serial.subarray(0, 32))
|
|
1078
|
+
+ $mol_base64_url_encode(serial.subarray(32, 64));
|
|
1085
1079
|
}
|
|
1086
1080
|
return new this(await $mol_crypto_native.subtle.importKey('jwk', {
|
|
1087
1081
|
crv: "P-256",
|
|
@@ -1099,8 +1093,8 @@ var $;
|
|
|
1099
1093
|
async toArray() {
|
|
1100
1094
|
const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
|
|
1101
1095
|
return new Uint8Array([
|
|
1102
|
-
...$
|
|
1103
|
-
...$
|
|
1096
|
+
...$mol_base64_url_decode(x),
|
|
1097
|
+
...$mol_base64_url_decode(y),
|
|
1104
1098
|
]);
|
|
1105
1099
|
}
|
|
1106
1100
|
async verify(data, sign) {
|
|
@@ -1118,9 +1112,9 @@ var $;
|
|
|
1118
1112
|
}
|
|
1119
1113
|
static async from(serial) {
|
|
1120
1114
|
if (typeof serial !== 'string') {
|
|
1121
|
-
serial = $
|
|
1122
|
-
+ $
|
|
1123
|
-
+ $
|
|
1115
|
+
serial = $mol_base64_url_encode(serial.subarray(0, 32))
|
|
1116
|
+
+ $mol_base64_url_encode(serial.subarray(32, 64))
|
|
1117
|
+
+ $mol_base64_url_encode(serial.subarray(64));
|
|
1124
1118
|
}
|
|
1125
1119
|
return new this(await $mol_crypto_native.subtle.importKey('jwk', {
|
|
1126
1120
|
crv: "P-256",
|
|
@@ -1139,9 +1133,9 @@ var $;
|
|
|
1139
1133
|
async toArray() {
|
|
1140
1134
|
const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
|
|
1141
1135
|
return new Uint8Array([
|
|
1142
|
-
...$
|
|
1143
|
-
...$
|
|
1144
|
-
...$
|
|
1136
|
+
...$mol_base64_url_decode(x),
|
|
1137
|
+
...$mol_base64_url_decode(y),
|
|
1138
|
+
...$mol_base64_url_decode(d),
|
|
1145
1139
|
]);
|
|
1146
1140
|
}
|
|
1147
1141
|
async sign(data) {
|
|
@@ -1214,7 +1208,12 @@ var $;
|
|
|
1214
1208
|
if (!val)
|
|
1215
1209
|
return null;
|
|
1216
1210
|
if ($.$mol_dev_format_head in val) {
|
|
1217
|
-
|
|
1211
|
+
try {
|
|
1212
|
+
return val[$.$mol_dev_format_head]();
|
|
1213
|
+
}
|
|
1214
|
+
catch (error) {
|
|
1215
|
+
return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
|
|
1216
|
+
}
|
|
1218
1217
|
}
|
|
1219
1218
|
if (typeof val === 'function') {
|
|
1220
1219
|
return $mol_dev_format_native(val);
|
|
@@ -3441,17 +3440,17 @@ var $;
|
|
|
3441
3440
|
(function ($) {
|
|
3442
3441
|
class $hyoo_crowd_fund extends $mol_object {
|
|
3443
3442
|
world;
|
|
3444
|
-
|
|
3445
|
-
constructor(world,
|
|
3443
|
+
node_class;
|
|
3444
|
+
constructor(world, node_class) {
|
|
3446
3445
|
super();
|
|
3447
3446
|
this.world = world;
|
|
3448
|
-
this.
|
|
3447
|
+
this.node_class = node_class;
|
|
3449
3448
|
}
|
|
3450
3449
|
Item(id) {
|
|
3451
3450
|
const [land, head] = id.split('!');
|
|
3452
3451
|
if (!head)
|
|
3453
3452
|
return this.Item(`${land}!0_0`);
|
|
3454
|
-
return this.world.land_sync(land).node(head, this.
|
|
3453
|
+
return this.world.land_sync(land).node(head, this.node_class);
|
|
3455
3454
|
}
|
|
3456
3455
|
make(law = [''], mod = [], add = []) {
|
|
3457
3456
|
const land = $mol_wire_sync(this.world).grab(law, mod, add);
|