@learncard/ceramic-plugin 1.0.18 → 1.0.19
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/ceramic-plugin.cjs.development.js +117 -49
- package/dist/ceramic-plugin.cjs.development.js.map +4 -4
- package/dist/ceramic-plugin.cjs.production.min.js +128 -128
- package/dist/ceramic-plugin.cjs.production.min.js.map +4 -4
- package/dist/ceramic-plugin.esm.js +117 -49
- package/dist/ceramic-plugin.esm.js.map +4 -4
- package/package.json +4 -4
|
@@ -8678,12 +8678,12 @@ var require_sha3 = __commonJS({
|
|
|
8678
8678
|
}
|
|
8679
8679
|
});
|
|
8680
8680
|
|
|
8681
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
8681
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/package.json
|
|
8682
8682
|
var require_package = __commonJS({
|
|
8683
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
8683
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/package.json"(exports, module2) {
|
|
8684
8684
|
module2.exports = {
|
|
8685
8685
|
name: "elliptic",
|
|
8686
|
-
version: "6.
|
|
8686
|
+
version: "6.6.1",
|
|
8687
8687
|
description: "EC cryptography",
|
|
8688
8688
|
main: "lib/elliptic.js",
|
|
8689
8689
|
files: [
|
|
@@ -8746,9 +8746,9 @@ var require_buffer = __commonJS({
|
|
|
8746
8746
|
}
|
|
8747
8747
|
});
|
|
8748
8748
|
|
|
8749
|
-
// ../../../node_modules/.pnpm/bn.js@4.12.
|
|
8749
|
+
// ../../../node_modules/.pnpm/bn.js@4.12.1/node_modules/bn.js/lib/bn.js
|
|
8750
8750
|
var require_bn = __commonJS({
|
|
8751
|
-
"../../../node_modules/.pnpm/bn.js@4.12.
|
|
8751
|
+
"../../../node_modules/.pnpm/bn.js@4.12.1/node_modules/bn.js/lib/bn.js"(exports, module2) {
|
|
8752
8752
|
(function(module3, exports2) {
|
|
8753
8753
|
"use strict";
|
|
8754
8754
|
function assert2(val, msg) {
|
|
@@ -9170,16 +9170,16 @@ var require_bn = __commonJS({
|
|
|
9170
9170
|
var w = this.words[i2];
|
|
9171
9171
|
var word = ((w << off | carry) & 16777215).toString(16);
|
|
9172
9172
|
carry = w >>> 24 - off & 16777215;
|
|
9173
|
-
if (carry !== 0 || i2 !== this.length - 1) {
|
|
9174
|
-
out = zeros[6 - word.length] + word + out;
|
|
9175
|
-
} else {
|
|
9176
|
-
out = word + out;
|
|
9177
|
-
}
|
|
9178
9173
|
off += 2;
|
|
9179
9174
|
if (off >= 26) {
|
|
9180
9175
|
off -= 26;
|
|
9181
9176
|
i2--;
|
|
9182
9177
|
}
|
|
9178
|
+
if (carry !== 0 || i2 !== this.length - 1) {
|
|
9179
|
+
out = zeros[6 - word.length] + word + out;
|
|
9180
|
+
} else {
|
|
9181
|
+
out = word + out;
|
|
9182
|
+
}
|
|
9183
9183
|
}
|
|
9184
9184
|
if (carry !== 0) {
|
|
9185
9185
|
out = carry.toString(16) + out;
|
|
@@ -11695,9 +11695,9 @@ var require_utils = __commonJS({
|
|
|
11695
11695
|
}
|
|
11696
11696
|
});
|
|
11697
11697
|
|
|
11698
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
11698
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/utils.js
|
|
11699
11699
|
var require_utils2 = __commonJS({
|
|
11700
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
11700
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/utils.js"(exports) {
|
|
11701
11701
|
"use strict";
|
|
11702
11702
|
var utils = exports;
|
|
11703
11703
|
var BN3 = require_bn();
|
|
@@ -11864,9 +11864,9 @@ var require_brorand = __commonJS({
|
|
|
11864
11864
|
}
|
|
11865
11865
|
});
|
|
11866
11866
|
|
|
11867
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
11867
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/base.js
|
|
11868
11868
|
var require_base = __commonJS({
|
|
11869
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
11869
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/base.js"(exports, module2) {
|
|
11870
11870
|
"use strict";
|
|
11871
11871
|
var BN3 = require_bn();
|
|
11872
11872
|
var utils = require_utils2();
|
|
@@ -12207,9 +12207,9 @@ var require_inherits_browser = __commonJS({
|
|
|
12207
12207
|
}
|
|
12208
12208
|
});
|
|
12209
12209
|
|
|
12210
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
12210
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/short.js
|
|
12211
12211
|
var require_short = __commonJS({
|
|
12212
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
12212
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/short.js"(exports, module2) {
|
|
12213
12213
|
"use strict";
|
|
12214
12214
|
var utils = require_utils2();
|
|
12215
12215
|
var BN3 = require_bn();
|
|
@@ -12909,9 +12909,9 @@ var require_short = __commonJS({
|
|
|
12909
12909
|
}
|
|
12910
12910
|
});
|
|
12911
12911
|
|
|
12912
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
12912
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/mont.js
|
|
12913
12913
|
var require_mont = __commonJS({
|
|
12914
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
12914
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/mont.js"(exports, module2) {
|
|
12915
12915
|
"use strict";
|
|
12916
12916
|
var BN3 = require_bn();
|
|
12917
12917
|
var inherits = require_inherits_browser();
|
|
@@ -13039,9 +13039,9 @@ var require_mont = __commonJS({
|
|
|
13039
13039
|
}
|
|
13040
13040
|
});
|
|
13041
13041
|
|
|
13042
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
13042
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/edwards.js
|
|
13043
13043
|
var require_edwards = __commonJS({
|
|
13044
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
13044
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/edwards.js"(exports, module2) {
|
|
13045
13045
|
"use strict";
|
|
13046
13046
|
var utils = require_utils2();
|
|
13047
13047
|
var BN3 = require_bn();
|
|
@@ -13342,9 +13342,9 @@ var require_edwards = __commonJS({
|
|
|
13342
13342
|
}
|
|
13343
13343
|
});
|
|
13344
13344
|
|
|
13345
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
13345
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/index.js
|
|
13346
13346
|
var require_curve = __commonJS({
|
|
13347
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
13347
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curve/index.js"(exports) {
|
|
13348
13348
|
"use strict";
|
|
13349
13349
|
var curve = exports;
|
|
13350
13350
|
curve.base = require_base();
|
|
@@ -15036,9 +15036,9 @@ var require_hash = __commonJS({
|
|
|
15036
15036
|
}
|
|
15037
15037
|
});
|
|
15038
15038
|
|
|
15039
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
15039
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js
|
|
15040
15040
|
var require_secp256k1 = __commonJS({
|
|
15041
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
15041
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js"(exports, module2) {
|
|
15042
15042
|
module2.exports = {
|
|
15043
15043
|
doubles: {
|
|
15044
15044
|
step: 4,
|
|
@@ -15822,9 +15822,9 @@ var require_secp256k1 = __commonJS({
|
|
|
15822
15822
|
}
|
|
15823
15823
|
});
|
|
15824
15824
|
|
|
15825
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
15825
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curves.js
|
|
15826
15826
|
var require_curves = __commonJS({
|
|
15827
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
15827
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/curves.js"(exports) {
|
|
15828
15828
|
"use strict";
|
|
15829
15829
|
var curves = exports;
|
|
15830
15830
|
var hash3 = require_hash();
|
|
@@ -16092,9 +16092,9 @@ var require_hmac_drbg = __commonJS({
|
|
|
16092
16092
|
}
|
|
16093
16093
|
});
|
|
16094
16094
|
|
|
16095
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
16095
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/ec/key.js
|
|
16096
16096
|
var require_key = __commonJS({
|
|
16097
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
16097
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/ec/key.js"(exports, module2) {
|
|
16098
16098
|
"use strict";
|
|
16099
16099
|
var BN3 = require_bn();
|
|
16100
16100
|
var utils = require_utils2();
|
|
@@ -16178,8 +16178,8 @@ var require_key = __commonJS({
|
|
|
16178
16178
|
KeyPair2.prototype.sign = /* @__PURE__ */ __name(function sign5(msg, enc, options) {
|
|
16179
16179
|
return this.ec.sign(msg, this, enc, options);
|
|
16180
16180
|
}, "sign");
|
|
16181
|
-
KeyPair2.prototype.verify = /* @__PURE__ */ __name(function verify4(msg, signature2) {
|
|
16182
|
-
return this.ec.verify(msg, signature2, this);
|
|
16181
|
+
KeyPair2.prototype.verify = /* @__PURE__ */ __name(function verify4(msg, signature2, options) {
|
|
16182
|
+
return this.ec.verify(msg, signature2, this, void 0, options);
|
|
16183
16183
|
}, "verify");
|
|
16184
16184
|
KeyPair2.prototype.inspect = /* @__PURE__ */ __name(function inspect4() {
|
|
16185
16185
|
return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >";
|
|
@@ -16187,9 +16187,9 @@ var require_key = __commonJS({
|
|
|
16187
16187
|
}
|
|
16188
16188
|
});
|
|
16189
16189
|
|
|
16190
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
16190
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/ec/signature.js
|
|
16191
16191
|
var require_signature = __commonJS({
|
|
16192
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
16192
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/ec/signature.js"(exports, module2) {
|
|
16193
16193
|
"use strict";
|
|
16194
16194
|
var BN3 = require_bn();
|
|
16195
16195
|
var utils = require_utils2();
|
|
@@ -16347,9 +16347,9 @@ var require_signature = __commonJS({
|
|
|
16347
16347
|
}
|
|
16348
16348
|
});
|
|
16349
16349
|
|
|
16350
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
16350
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/ec/index.js
|
|
16351
16351
|
var require_ec = __commonJS({
|
|
16352
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
16352
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/ec/index.js"(exports, module2) {
|
|
16353
16353
|
"use strict";
|
|
16354
16354
|
var BN3 = require_bn();
|
|
16355
16355
|
var HmacDRBG2 = require_hmac_drbg();
|
|
@@ -16411,8 +16411,23 @@ var require_ec = __commonJS({
|
|
|
16411
16411
|
return this.keyFromPrivate(priv);
|
|
16412
16412
|
}
|
|
16413
16413
|
}, "genKeyPair");
|
|
16414
|
-
EC2.prototype._truncateToN = /* @__PURE__ */ __name(function _truncateToN2(msg, truncOnly) {
|
|
16415
|
-
var
|
|
16414
|
+
EC2.prototype._truncateToN = /* @__PURE__ */ __name(function _truncateToN2(msg, truncOnly, bitLength) {
|
|
16415
|
+
var byteLength;
|
|
16416
|
+
if (BN3.isBN(msg) || typeof msg === "number") {
|
|
16417
|
+
msg = new BN3(msg, 16);
|
|
16418
|
+
byteLength = msg.byteLength();
|
|
16419
|
+
} else if (typeof msg === "object") {
|
|
16420
|
+
byteLength = msg.length;
|
|
16421
|
+
msg = new BN3(msg, 16);
|
|
16422
|
+
} else {
|
|
16423
|
+
var str = msg.toString();
|
|
16424
|
+
byteLength = str.length + 1 >>> 1;
|
|
16425
|
+
msg = new BN3(str, 16);
|
|
16426
|
+
}
|
|
16427
|
+
if (typeof bitLength !== "number") {
|
|
16428
|
+
bitLength = byteLength * 8;
|
|
16429
|
+
}
|
|
16430
|
+
var delta = bitLength - this.n.bitLength();
|
|
16416
16431
|
if (delta > 0)
|
|
16417
16432
|
msg = msg.ushrn(delta);
|
|
16418
16433
|
if (!truncOnly && msg.cmp(this.n) >= 0)
|
|
@@ -16427,11 +16442,22 @@ var require_ec = __commonJS({
|
|
|
16427
16442
|
}
|
|
16428
16443
|
if (!options)
|
|
16429
16444
|
options = {};
|
|
16445
|
+
if (typeof msg !== "string" && typeof msg !== "number" && !BN3.isBN(msg)) {
|
|
16446
|
+
assert2(
|
|
16447
|
+
typeof msg === "object" && msg && typeof msg.length === "number",
|
|
16448
|
+
"Expected message to be an array-like, a hex string, or a BN instance"
|
|
16449
|
+
);
|
|
16450
|
+
assert2(msg.length >>> 0 === msg.length);
|
|
16451
|
+
for (var i2 = 0; i2 < msg.length; i2++)
|
|
16452
|
+
assert2((msg[i2] & 255) === msg[i2]);
|
|
16453
|
+
}
|
|
16430
16454
|
key2 = this.keyFromPrivate(key2, enc);
|
|
16431
|
-
msg = this._truncateToN(
|
|
16455
|
+
msg = this._truncateToN(msg, false, options.msgBitLength);
|
|
16456
|
+
assert2(!msg.isNeg(), "Can not sign a negative message");
|
|
16432
16457
|
var bytes = this.n.byteLength();
|
|
16433
16458
|
var bkey = key2.getPrivate().toArray("be", bytes);
|
|
16434
16459
|
var nonce = msg.toArray("be", bytes);
|
|
16460
|
+
assert2(new BN3(nonce).eq(msg), "Can not sign message");
|
|
16435
16461
|
var drbg = new HmacDRBG2({
|
|
16436
16462
|
hash: this.hash,
|
|
16437
16463
|
entropy: bkey,
|
|
@@ -16464,8 +16490,10 @@ var require_ec = __commonJS({
|
|
|
16464
16490
|
return new Signature2({ r: r2, s: s2, recoveryParam });
|
|
16465
16491
|
}
|
|
16466
16492
|
}, "sign");
|
|
16467
|
-
EC2.prototype.verify = /* @__PURE__ */ __name(function verify4(msg, signature2, key2, enc) {
|
|
16468
|
-
|
|
16493
|
+
EC2.prototype.verify = /* @__PURE__ */ __name(function verify4(msg, signature2, key2, enc, options) {
|
|
16494
|
+
if (!options)
|
|
16495
|
+
options = {};
|
|
16496
|
+
msg = this._truncateToN(msg, false, options.msgBitLength);
|
|
16469
16497
|
key2 = this.keyFromPublic(key2, enc);
|
|
16470
16498
|
signature2 = new Signature2(signature2, "hex");
|
|
16471
16499
|
var r2 = signature2.r;
|
|
@@ -16528,9 +16556,9 @@ var require_ec = __commonJS({
|
|
|
16528
16556
|
}
|
|
16529
16557
|
});
|
|
16530
16558
|
|
|
16531
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
16559
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/eddsa/key.js
|
|
16532
16560
|
var require_key2 = __commonJS({
|
|
16533
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
16561
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/eddsa/key.js"(exports, module2) {
|
|
16534
16562
|
"use strict";
|
|
16535
16563
|
var utils = require_utils2();
|
|
16536
16564
|
var assert2 = utils.assert;
|
|
@@ -16603,9 +16631,9 @@ var require_key2 = __commonJS({
|
|
|
16603
16631
|
}
|
|
16604
16632
|
});
|
|
16605
16633
|
|
|
16606
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
16634
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/eddsa/signature.js
|
|
16607
16635
|
var require_signature2 = __commonJS({
|
|
16608
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
16636
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/eddsa/signature.js"(exports, module2) {
|
|
16609
16637
|
"use strict";
|
|
16610
16638
|
var BN3 = require_bn();
|
|
16611
16639
|
var utils = require_utils2();
|
|
@@ -16654,9 +16682,9 @@ var require_signature2 = __commonJS({
|
|
|
16654
16682
|
}
|
|
16655
16683
|
});
|
|
16656
16684
|
|
|
16657
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
16685
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/eddsa/index.js
|
|
16658
16686
|
var require_eddsa = __commonJS({
|
|
16659
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
16687
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic/eddsa/index.js"(exports, module2) {
|
|
16660
16688
|
"use strict";
|
|
16661
16689
|
var hash3 = require_hash();
|
|
16662
16690
|
var curves = require_curves();
|
|
@@ -16743,9 +16771,9 @@ var require_eddsa = __commonJS({
|
|
|
16743
16771
|
}
|
|
16744
16772
|
});
|
|
16745
16773
|
|
|
16746
|
-
// ../../../node_modules/.pnpm/elliptic@6.
|
|
16774
|
+
// ../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic.js
|
|
16747
16775
|
var require_elliptic = __commonJS({
|
|
16748
|
-
"../../../node_modules/.pnpm/elliptic@6.
|
|
16776
|
+
"../../../node_modules/.pnpm/elliptic@6.6.1/node_modules/elliptic/lib/elliptic.js"(exports) {
|
|
16749
16777
|
"use strict";
|
|
16750
16778
|
var elliptic = exports;
|
|
16751
16779
|
elliptic.version = require_package().version;
|
|
@@ -46021,7 +46049,7 @@ var StreamRef;
|
|
|
46021
46049
|
StreamRef2.from = from4;
|
|
46022
46050
|
})(StreamRef || (StreamRef = {}));
|
|
46023
46051
|
|
|
46024
|
-
// ../../../node_modules/.pnpm/tslib@2.8.
|
|
46052
|
+
// ../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
|
46025
46053
|
var extendStatics = /* @__PURE__ */ __name(function(d, b) {
|
|
46026
46054
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
46027
46055
|
d2.__proto__ = b2;
|
|
@@ -53086,6 +53114,8 @@ var mod = /* @__PURE__ */ Object.freeze({
|
|
|
53086
53114
|
});
|
|
53087
53115
|
|
|
53088
53116
|
// ../../learn-card-types/dist/types.esm.js
|
|
53117
|
+
var __defProp2 = Object.defineProperty;
|
|
53118
|
+
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", { value, configurable: true }), "__name");
|
|
53089
53119
|
var ContextValidator = mod.array(mod.string().or(mod.record(mod.any())));
|
|
53090
53120
|
var AchievementCriteriaValidator = mod.object({
|
|
53091
53121
|
type: mod.string().optional(),
|
|
@@ -53489,6 +53519,35 @@ var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
|
|
|
53489
53519
|
var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
|
|
53490
53520
|
records: EncryptedCredentialRecordValidator.array()
|
|
53491
53521
|
});
|
|
53522
|
+
var parseRegexString = /* @__PURE__ */ __name2((regexStr) => {
|
|
53523
|
+
const match = regexStr.match(/^\/(.*)\/([gimsuy]*)$/);
|
|
53524
|
+
if (!match)
|
|
53525
|
+
throw new Error("Invalid RegExp string format");
|
|
53526
|
+
return { pattern: match[1], flags: match[2] };
|
|
53527
|
+
}, "parseRegexString");
|
|
53528
|
+
var RegExpValidator = mod.instanceof(RegExp).or(
|
|
53529
|
+
mod.string().refine(
|
|
53530
|
+
(str) => {
|
|
53531
|
+
try {
|
|
53532
|
+
parseRegexString(str);
|
|
53533
|
+
return true;
|
|
53534
|
+
} catch {
|
|
53535
|
+
return false;
|
|
53536
|
+
}
|
|
53537
|
+
},
|
|
53538
|
+
{
|
|
53539
|
+
message: "Invalid RegExp string format. Must be in format '/pattern/flags'"
|
|
53540
|
+
}
|
|
53541
|
+
).transform((str) => {
|
|
53542
|
+
const { pattern, flags } = parseRegexString(str);
|
|
53543
|
+
try {
|
|
53544
|
+
return new RegExp(pattern, flags);
|
|
53545
|
+
} catch (error) {
|
|
53546
|
+
throw new Error(`Invalid RegExp: ${error.message}`);
|
|
53547
|
+
}
|
|
53548
|
+
})
|
|
53549
|
+
);
|
|
53550
|
+
var StringQuery = mod.string().or(mod.object({ $in: mod.string().array() })).or(mod.object({ $regex: RegExpValidator }));
|
|
53492
53551
|
var LCNProfileValidator = mod.object({
|
|
53493
53552
|
profileId: mod.string().min(3).max(40),
|
|
53494
53553
|
displayName: mod.string().default(""),
|
|
@@ -53503,6 +53562,16 @@ var LCNProfileValidator = mod.object({
|
|
|
53503
53562
|
type: mod.string().optional(),
|
|
53504
53563
|
notificationsWebhook: mod.string().url().startsWith("http").optional()
|
|
53505
53564
|
});
|
|
53565
|
+
var LCNProfileQueryValidator = mod.object({
|
|
53566
|
+
profileId: StringQuery,
|
|
53567
|
+
displayName: StringQuery,
|
|
53568
|
+
shortBio: StringQuery,
|
|
53569
|
+
bio: StringQuery,
|
|
53570
|
+
email: StringQuery,
|
|
53571
|
+
websiteLink: StringQuery,
|
|
53572
|
+
isServiceProfile: mod.boolean(),
|
|
53573
|
+
type: StringQuery
|
|
53574
|
+
}).partial();
|
|
53506
53575
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
53507
53576
|
records: LCNProfileValidator.array()
|
|
53508
53577
|
});
|
|
@@ -53543,7 +53612,6 @@ var BoostValidator = mod.object({
|
|
|
53543
53612
|
meta: mod.record(mod.any()).optional(),
|
|
53544
53613
|
claimPermissions: BoostPermissionsValidator.optional()
|
|
53545
53614
|
});
|
|
53546
|
-
var StringQuery = mod.string().or(mod.object({ $in: mod.string().array() })).or(mod.object({ $regex: mod.instanceof(RegExp) }));
|
|
53547
53615
|
var BoostQueryValidator = mod.object({
|
|
53548
53616
|
uri: StringQuery,
|
|
53549
53617
|
name: StringQuery,
|