xasdd6 1.0.0 → 1.0.2
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/THIRD_PARTY_LICENSES.txt +411 -0
- package/dist/xasdd6.es.js +266 -213
- package/dist/xasdd6.umd.cjs +87 -0
- package/package.json +6 -14
- package/dist/xasdd6.umd.js +0 -87
package/dist/xasdd6.es.js
CHANGED
|
@@ -474,29 +474,29 @@ var E = T({
|
|
|
474
474
|
encodingLength(e) {
|
|
475
475
|
return E.encodingLength(e) + 2;
|
|
476
476
|
}
|
|
477
|
-
}),
|
|
477
|
+
}), ve = T({
|
|
478
478
|
encode(e, t, n) {
|
|
479
|
-
t ||= new Uint8Array(
|
|
479
|
+
t ||= new Uint8Array(ve.encodingLength(e)), n ||= 0;
|
|
480
480
|
let r = n;
|
|
481
|
-
return n += 2, E.encode(e.mname, t, n), n += E.encode.bytes, E.encode(e.rname, t, n), n += E.encode.bytes, S(t, e.serial || 0, n), n += 4, S(t, e.refresh || 0, n), n += 4, S(t, e.retry || 0, n), n += 4, S(t, e.expire || 0, n), n += 4, S(t, e.minimum || 0, n), n += 4, C(t, n - r - 2, r),
|
|
481
|
+
return n += 2, E.encode(e.mname, t, n), n += E.encode.bytes, E.encode(e.rname, t, n), n += E.encode.bytes, S(t, e.serial || 0, n), n += 4, S(t, e.refresh || 0, n), n += 4, S(t, e.retry || 0, n), n += 4, S(t, e.expire || 0, n), n += 4, S(t, e.minimum || 0, n), n += 4, C(t, n - r - 2, r), ve.encode.bytes = n - r, t;
|
|
482
482
|
},
|
|
483
483
|
decode(e, t) {
|
|
484
484
|
t ||= 0;
|
|
485
485
|
let n = t, r = {};
|
|
486
|
-
return t += 2, r.mname = E.decode(e, t), t += E.decode.bytes, r.rname = E.decode(e, t), t += E.decode.bytes, r.serial = b(e, t), t += 4, r.refresh = b(e, t), t += 4, r.retry = b(e, t), t += 4, r.expire = b(e, t), t += 4, r.minimum = b(e, t), t += 4,
|
|
486
|
+
return t += 2, r.mname = E.decode(e, t), t += E.decode.bytes, r.rname = E.decode(e, t), t += E.decode.bytes, r.serial = b(e, t), t += 4, r.refresh = b(e, t), t += 4, r.retry = b(e, t), t += 4, r.expire = b(e, t), t += 4, r.minimum = b(e, t), t += 4, ve.decode.bytes = t - n, r;
|
|
487
487
|
},
|
|
488
488
|
encodingLength(e) {
|
|
489
489
|
return 22 + E.encodingLength(e.mname) + E.encodingLength(e.rname);
|
|
490
490
|
}
|
|
491
|
-
}),
|
|
491
|
+
}), ye = T({
|
|
492
492
|
encode(e, t, n) {
|
|
493
493
|
Array.isArray(e) || (e = [e]);
|
|
494
494
|
for (let t = 0; t < e.length; t++) if (typeof e[t] == "string" && (e[t] = oe(e[t])), !v(e[t])) throw Error("Must be a Buffer");
|
|
495
|
-
t ||= new Uint8Array(
|
|
495
|
+
t ||= new Uint8Array(ye.encodingLength(e)), n ||= 0;
|
|
496
496
|
let r = n;
|
|
497
497
|
return n += 2, e.forEach(function(e) {
|
|
498
498
|
t[n++] = e.length, w(e, t, n, 0, e.length), n += e.length;
|
|
499
|
-
}), C(t, n - r - 2, r),
|
|
499
|
+
}), C(t, n - r - 2, r), ye.encode.bytes = n - r, t;
|
|
500
500
|
},
|
|
501
501
|
decode(e, t) {
|
|
502
502
|
t ||= 0;
|
|
@@ -508,7 +508,7 @@ var E = T({
|
|
|
508
508
|
if (--r, r < n) throw Error("Buffer overflow");
|
|
509
509
|
i.push(e.slice(t, t + n)), t += n, r -= n;
|
|
510
510
|
}
|
|
511
|
-
return
|
|
511
|
+
return ye.decode.bytes = t - n, i;
|
|
512
512
|
},
|
|
513
513
|
encodingLength(e) {
|
|
514
514
|
Array.isArray(e) || (e = [e]);
|
|
@@ -517,122 +517,122 @@ var E = T({
|
|
|
517
517
|
t += typeof e == "string" ? y(e) + 1 : e.length + 1;
|
|
518
518
|
}), t;
|
|
519
519
|
}
|
|
520
|
-
}),
|
|
520
|
+
}), be = T({
|
|
521
521
|
encode(e, t, n) {
|
|
522
|
-
t ||= new Uint8Array(
|
|
522
|
+
t ||= new Uint8Array(be.encodingLength(e)), n ||= 0, typeof e == "string" && (e = oe(e)), e ||= /* @__PURE__ */ new Uint8Array();
|
|
523
523
|
let r = n;
|
|
524
524
|
n += 2;
|
|
525
525
|
let i = e.length;
|
|
526
|
-
return w(e, t, n, 0, i), n += i, C(t, n - r - 2, r),
|
|
526
|
+
return w(e, t, n, 0, i), n += i, C(t, n - r - 2, r), be.encode.bytes = n - r, t;
|
|
527
527
|
},
|
|
528
528
|
decode(e, t) {
|
|
529
529
|
t ||= 0;
|
|
530
530
|
let n = t, r = x(e, t);
|
|
531
531
|
t += 2;
|
|
532
532
|
let i = e.slice(t, t + r);
|
|
533
|
-
return t += r,
|
|
533
|
+
return t += r, be.decode.bytes = t - n, i;
|
|
534
534
|
},
|
|
535
535
|
encodingLength(e) {
|
|
536
536
|
return e ? (v(e) ? e.length : y(e)) + 2 : 2;
|
|
537
537
|
}
|
|
538
|
-
}),
|
|
538
|
+
}), j = T({
|
|
539
539
|
encode(e, t, n) {
|
|
540
|
-
t ||= new Uint8Array(
|
|
540
|
+
t ||= new Uint8Array(j.encodingLength(e)), n ||= 0;
|
|
541
541
|
let r = n;
|
|
542
|
-
return n += 2, D.encode(e.cpu, t, n), n += D.encode.bytes, D.encode(e.os, t, n), n += D.encode.bytes, C(t, n - r - 2, r),
|
|
542
|
+
return n += 2, D.encode(e.cpu, t, n), n += D.encode.bytes, D.encode(e.os, t, n), n += D.encode.bytes, C(t, n - r - 2, r), j.encode.bytes = n - r, t;
|
|
543
543
|
},
|
|
544
544
|
decode(e, t) {
|
|
545
545
|
t ||= 0;
|
|
546
546
|
let n = t, r = {};
|
|
547
|
-
return t += 2, r.cpu = D.decode(e, t), t += D.decode.bytes, r.os = D.decode(e, t), t += D.decode.bytes,
|
|
547
|
+
return t += 2, r.cpu = D.decode(e, t), t += D.decode.bytes, r.os = D.decode(e, t), t += D.decode.bytes, j.decode.bytes = t - n, r;
|
|
548
548
|
},
|
|
549
549
|
encodingLength(e) {
|
|
550
550
|
return D.encodingLength(e.cpu) + D.encodingLength(e.os) + 2;
|
|
551
551
|
}
|
|
552
|
-
}),
|
|
552
|
+
}), M = T({
|
|
553
553
|
encode(e, t, n) {
|
|
554
|
-
return t ||= new Uint8Array(
|
|
554
|
+
return t ||= new Uint8Array(M.encodingLength(e)), n ||= 0, E.encode(e, t, n + 2), C(t, E.encode.bytes, n), M.encode.bytes = E.encode.bytes + 2, t;
|
|
555
555
|
},
|
|
556
556
|
decode(e, t) {
|
|
557
557
|
t ||= 0;
|
|
558
558
|
let n = E.decode(e, t + 2);
|
|
559
|
-
return
|
|
559
|
+
return M.decode.bytes = E.decode.bytes + 2, n;
|
|
560
560
|
},
|
|
561
561
|
encodingLength(e) {
|
|
562
562
|
return E.encodingLength(e) + 2;
|
|
563
563
|
}
|
|
564
|
-
}),
|
|
564
|
+
}), N = T({
|
|
565
565
|
encode(e, t, n) {
|
|
566
|
-
t ||= new Uint8Array(
|
|
566
|
+
t ||= new Uint8Array(N.encodingLength(e)), n ||= 0, C(t, e.priority || 0, n + 2), C(t, e.weight || 0, n + 4), C(t, e.port || 0, n + 6), E.encode(e.target, t, n + 8);
|
|
567
567
|
let r = E.encode.bytes + 6;
|
|
568
|
-
return C(t, r, n),
|
|
568
|
+
return C(t, r, n), N.encode.bytes = r + 2, t;
|
|
569
569
|
},
|
|
570
570
|
decode(e, t) {
|
|
571
571
|
t ||= 0;
|
|
572
572
|
let n = x(e, t), r = {};
|
|
573
|
-
return r.priority = x(e, t + 2), r.weight = x(e, t + 4), r.port = x(e, t + 6), r.target = E.decode(e, t + 8),
|
|
573
|
+
return r.priority = x(e, t + 2), r.weight = x(e, t + 4), r.port = x(e, t + 6), r.target = E.decode(e, t + 8), N.decode.bytes = n + 2, r;
|
|
574
574
|
},
|
|
575
575
|
encodingLength(e) {
|
|
576
576
|
return 8 + E.encodingLength(e.target);
|
|
577
577
|
}
|
|
578
|
-
}),
|
|
578
|
+
}), P = T({
|
|
579
579
|
encode(e, t, n) {
|
|
580
|
-
let r =
|
|
581
|
-
return t ||= new Uint8Array(
|
|
580
|
+
let r = P.encodingLength(e);
|
|
581
|
+
return t ||= new Uint8Array(P.encodingLength(e)), n ||= 0, e.issuerCritical && (e.flags = P.ISSUER_CRITICAL), C(t, r - 2, n), n += 2, t[n] = e.flags || 0, n += 1, D.encode(e.tag, t, n), n += D.encode.bytes, se(t, e.value, n), n += y(e.value), P.encode.bytes = r, t;
|
|
582
582
|
},
|
|
583
583
|
decode(e, t) {
|
|
584
584
|
t ||= 0;
|
|
585
585
|
let n = x(e, t);
|
|
586
586
|
t += 2;
|
|
587
587
|
let r = t, i = {};
|
|
588
|
-
return i.flags = e[t], t += 1, i.tag = D.decode(e, t), t += D.decode.bytes, i.value = _(e, t, r + n), i.issuerCritical = !!(i.flags &
|
|
588
|
+
return i.flags = e[t], t += 1, i.tag = D.decode(e, t), t += D.decode.bytes, i.value = _(e, t, r + n), i.issuerCritical = !!(i.flags & P.ISSUER_CRITICAL), P.decode.bytes = n + 2, i;
|
|
589
589
|
},
|
|
590
590
|
encodingLength(e) {
|
|
591
591
|
return D.encodingLength(e.tag) + D.encodingLength(e.value) + 2;
|
|
592
592
|
}
|
|
593
593
|
});
|
|
594
|
-
|
|
595
|
-
var
|
|
594
|
+
P.ISSUER_CRITICAL = 128;
|
|
595
|
+
var F = T({
|
|
596
596
|
encode(e, t, n) {
|
|
597
|
-
t ||= new Uint8Array(
|
|
597
|
+
t ||= new Uint8Array(F.encodingLength(e)), n ||= 0;
|
|
598
598
|
let r = n;
|
|
599
|
-
return n += 2, C(t, e.preference || 0, n), n += 2, E.encode(e.exchange, t, n), n += E.encode.bytes, C(t, n - r - 2, r),
|
|
599
|
+
return n += 2, C(t, e.preference || 0, n), n += 2, E.encode(e.exchange, t, n), n += E.encode.bytes, C(t, n - r - 2, r), F.encode.bytes = n - r, t;
|
|
600
600
|
},
|
|
601
601
|
decode(e, t) {
|
|
602
602
|
t ||= 0;
|
|
603
603
|
let n = t, r = {};
|
|
604
|
-
return t += 2, r.preference = x(e, t), t += 2, r.exchange = E.decode(e, t), t += E.decode.bytes,
|
|
604
|
+
return t += 2, r.preference = x(e, t), t += 2, r.exchange = E.decode(e, t), t += E.decode.bytes, F.decode.bytes = t - n, r;
|
|
605
605
|
},
|
|
606
606
|
encodingLength(e) {
|
|
607
607
|
return 4 + E.encodingLength(e.exchange);
|
|
608
608
|
}
|
|
609
|
-
}),
|
|
609
|
+
}), xe = T({
|
|
610
610
|
encode(e, t, n) {
|
|
611
|
-
return t ||= new Uint8Array(
|
|
611
|
+
return t ||= new Uint8Array(xe.encodingLength(e)), n ||= 0, C(t, 4, n), n += 2, a.encode(e, t, n), t;
|
|
612
612
|
},
|
|
613
613
|
decode(e, t) {
|
|
614
614
|
return t ||= 0, t += 2, a.decode(e, t);
|
|
615
615
|
},
|
|
616
616
|
bytes: 6
|
|
617
|
-
}),
|
|
617
|
+
}), I = T({
|
|
618
618
|
encode(e, t, n) {
|
|
619
|
-
return t ||= new Uint8Array(
|
|
619
|
+
return t ||= new Uint8Array(I.encodingLength(e)), n ||= 0, C(t, 16, n), n += 2, o.encode(e, t, n), I.encode.bytes = 18, t;
|
|
620
620
|
},
|
|
621
621
|
decode(e, t) {
|
|
622
622
|
t ||= 0, t += 2;
|
|
623
623
|
let n = o.decode(e, t);
|
|
624
|
-
return
|
|
624
|
+
return I.decode.bytes = 18, n;
|
|
625
625
|
},
|
|
626
626
|
bytes: 18
|
|
627
|
-
}),
|
|
627
|
+
}), Se = (e) => new Uint8Array(e), L = T({
|
|
628
628
|
encode(e, t, n) {
|
|
629
|
-
t ||= new Uint8Array(
|
|
629
|
+
t ||= new Uint8Array(L.encodingLength(e)), n ||= 0;
|
|
630
630
|
let r = n, i = re(e.code);
|
|
631
631
|
if (C(t, i, n), n += 2, e.data) C(t, e.data.length, n), n += 2, w(e.data, t, n), n += e.data.length;
|
|
632
632
|
else switch (i) {
|
|
633
633
|
case 8:
|
|
634
634
|
{
|
|
635
|
-
let r = e.sourcePrefixLength || 0, i = e.family || c(e.ip,
|
|
635
|
+
let r = e.sourcePrefixLength || 0, i = e.family || c(e.ip, Se), a = l(e.ip, Se), o = Math.ceil(r / 8);
|
|
636
636
|
C(t, o + 4, n), n += 2, C(t, i, n), n += 2, t[n++] = r, t[n++] = e.scopePrefixLength || 0, w(a, t, n, 0, o), n += o;
|
|
637
637
|
}
|
|
638
638
|
break;
|
|
@@ -654,7 +654,7 @@ var R = T({
|
|
|
654
654
|
break;
|
|
655
655
|
default: throw Error(`Unknown roption code: ${e.code}`);
|
|
656
656
|
}
|
|
657
|
-
return
|
|
657
|
+
return L.encode.bytes = n - r, t;
|
|
658
658
|
},
|
|
659
659
|
decode(e, t) {
|
|
660
660
|
t ||= 0;
|
|
@@ -676,7 +676,7 @@ var R = T({
|
|
|
676
676
|
n.tags = [];
|
|
677
677
|
for (let i = 0; i < r; i += 2) n.tags.push(x(e, t)), t += 2;
|
|
678
678
|
}
|
|
679
|
-
return
|
|
679
|
+
return L.decode.bytes = r + 4, n;
|
|
680
680
|
},
|
|
681
681
|
encodingLength(e) {
|
|
682
682
|
if (e.data) return e.data.length + 4;
|
|
@@ -691,73 +691,73 @@ var R = T({
|
|
|
691
691
|
}
|
|
692
692
|
throw Error(`Unknown roption code: ${e.code}`);
|
|
693
693
|
}
|
|
694
|
-
}),
|
|
694
|
+
}), R = T({
|
|
695
695
|
encode(e, t, n) {
|
|
696
|
-
t ||= new Uint8Array(
|
|
697
|
-
let r = n, i =
|
|
698
|
-
return C(t, i, n), n =
|
|
696
|
+
t ||= new Uint8Array(R.encodingLength(e)), n ||= 0;
|
|
697
|
+
let r = n, i = X(e, L);
|
|
698
|
+
return C(t, i, n), n = Z(e, L, t, n + 2), R.encode.bytes = n - r, t;
|
|
699
699
|
},
|
|
700
700
|
decode(e, t) {
|
|
701
701
|
t ||= 0;
|
|
702
702
|
let n = t, r = [], i = x(e, t);
|
|
703
703
|
t += 2;
|
|
704
704
|
let a = 0;
|
|
705
|
-
for (; i > 0;) r[a++] =
|
|
706
|
-
return
|
|
705
|
+
for (; i > 0;) r[a++] = L.decode(e, t), t += L.decode.bytes, i -= L.decode.bytes;
|
|
706
|
+
return R.decode.bytes = t - n, r;
|
|
707
707
|
},
|
|
708
708
|
encodingLength(e) {
|
|
709
|
-
return 2 +
|
|
709
|
+
return 2 + X(e || [], L);
|
|
710
710
|
}
|
|
711
|
-
}),
|
|
711
|
+
}), z = T({
|
|
712
712
|
encode(e, t, n) {
|
|
713
|
-
t ||= new Uint8Array(
|
|
713
|
+
t ||= new Uint8Array(z.encodingLength(e)), n ||= 0;
|
|
714
714
|
let r = n, i = e.key;
|
|
715
715
|
if (!v(i)) throw Error("Key must be a Buffer");
|
|
716
|
-
return n += 2, C(t, e.flags, n), n += 2, t[n] =
|
|
716
|
+
return n += 2, C(t, e.flags, n), n += 2, t[n] = z.PROTOCOL_DNSSEC, n += 1, t[n] = e.algorithm, n += 1, w(i, t, n, 0, i.length), n += i.length, z.encode.bytes = n - r, C(t, z.encode.bytes - 2, r), t;
|
|
717
717
|
},
|
|
718
718
|
decode(e, t) {
|
|
719
719
|
t ||= 0;
|
|
720
720
|
let n = t, r = {}, i = x(e, t);
|
|
721
|
-
if (t += 2, r.flags = x(e, t), t += 2, e[t] !==
|
|
722
|
-
return t += 1, r.algorithm = e[t], t += 1, r.key = e.slice(t, n + i + 2), t += r.key.length,
|
|
721
|
+
if (t += 2, r.flags = x(e, t), t += 2, e[t] !== z.PROTOCOL_DNSSEC) throw Error("Protocol must be 3");
|
|
722
|
+
return t += 1, r.algorithm = e[t], t += 1, r.key = e.slice(t, n + i + 2), t += r.key.length, z.decode.bytes = t - n, r;
|
|
723
723
|
},
|
|
724
724
|
encodingLength(e) {
|
|
725
725
|
return 6 + y(e.key);
|
|
726
726
|
}
|
|
727
727
|
});
|
|
728
|
-
|
|
729
|
-
var
|
|
728
|
+
z.PROTOCOL_DNSSEC = 3, z.ZONE_KEY = 128, z.SECURE_ENTRYPOINT = 32768;
|
|
729
|
+
var B = T({
|
|
730
730
|
encode(e, t, n) {
|
|
731
|
-
t ||= new Uint8Array(
|
|
731
|
+
t ||= new Uint8Array(B.encodingLength(e)), n ||= 0;
|
|
732
732
|
let r = n, i = e.signature;
|
|
733
733
|
if (!v(i)) throw Error("Signature must be a Buffer");
|
|
734
|
-
return n += 2, C(t, f(e.typeCovered), n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.labels, n += 1, S(t, e.originalTTL, n), n += 4, S(t, e.expiration, n), n += 4, S(t, e.inception, n), n += 4, C(t, e.keyTag, n), n += 2, E.encode(e.signersName, t, n), n += E.encode.bytes, w(i, t, n, 0, i.length), n += i.length,
|
|
734
|
+
return n += 2, C(t, f(e.typeCovered), n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.labels, n += 1, S(t, e.originalTTL, n), n += 4, S(t, e.expiration, n), n += 4, S(t, e.inception, n), n += 4, C(t, e.keyTag, n), n += 2, E.encode(e.signersName, t, n), n += E.encode.bytes, w(i, t, n, 0, i.length), n += i.length, B.encode.bytes = n - r, C(t, B.encode.bytes - 2, r), t;
|
|
735
735
|
},
|
|
736
736
|
decode(e, t) {
|
|
737
737
|
t ||= 0;
|
|
738
738
|
let n = t, r = {}, i = x(e, t);
|
|
739
|
-
return t += 2, r.typeCovered = d(x(e, t)), t += 2, r.algorithm = e[t], t += 1, r.labels = e[t], t += 1, r.originalTTL = b(e, t), t += 4, r.expiration = b(e, t), t += 4, r.inception = b(e, t), t += 4, r.keyTag = x(e, t), t += 2, r.signersName = E.decode(e, t), t += E.decode.bytes, r.signature = e.slice(t, n + i + 2), t += r.signature.length,
|
|
739
|
+
return t += 2, r.typeCovered = d(x(e, t)), t += 2, r.algorithm = e[t], t += 1, r.labels = e[t], t += 1, r.originalTTL = b(e, t), t += 4, r.expiration = b(e, t), t += 4, r.inception = b(e, t), t += 4, r.keyTag = x(e, t), t += 2, r.signersName = E.decode(e, t), t += E.decode.bytes, r.signature = e.slice(t, n + i + 2), t += r.signature.length, B.decode.bytes = t - n, r;
|
|
740
740
|
},
|
|
741
741
|
encodingLength(e) {
|
|
742
742
|
return 20 + E.encodingLength(e.signersName) + y(e.signature);
|
|
743
743
|
}
|
|
744
|
-
}),
|
|
744
|
+
}), V = T({
|
|
745
745
|
encode(e, t, n) {
|
|
746
|
-
t ||= new Uint8Array(
|
|
746
|
+
t ||= new Uint8Array(V.encodingLength(e)), n ||= 0;
|
|
747
747
|
let r = n;
|
|
748
|
-
return n += 2, E.encode(e.mbox || ".", t, n), n += E.encode.bytes, E.encode(e.txt || ".", t, n), n += E.encode.bytes,
|
|
748
|
+
return n += 2, E.encode(e.mbox || ".", t, n), n += E.encode.bytes, E.encode(e.txt || ".", t, n), n += E.encode.bytes, V.encode.bytes = n - r, C(t, V.encode.bytes - 2, r), t;
|
|
749
749
|
},
|
|
750
750
|
decode(e, t) {
|
|
751
751
|
t ||= 0;
|
|
752
752
|
let n = t, r = {};
|
|
753
|
-
return t += 2, r.mbox = E.decode(e, t) || ".", t += E.decode.bytes, r.txt = E.decode(e, t) || ".", t += E.decode.bytes,
|
|
753
|
+
return t += 2, r.mbox = E.decode(e, t) || ".", t += E.decode.bytes, r.txt = E.decode(e, t) || ".", t += E.decode.bytes, V.decode.bytes = t - n, r;
|
|
754
754
|
},
|
|
755
755
|
encodingLength(e) {
|
|
756
756
|
return 2 + E.encodingLength(e.mbox || ".") + E.encodingLength(e.txt || ".");
|
|
757
757
|
}
|
|
758
|
-
}),
|
|
758
|
+
}), H = T({
|
|
759
759
|
encode(e, t, n) {
|
|
760
|
-
t ||= new Uint8Array(
|
|
760
|
+
t ||= new Uint8Array(H.encodingLength(e)), n ||= 0;
|
|
761
761
|
let r = n, i = [];
|
|
762
762
|
for (let t = 0; t < e.length; t++) {
|
|
763
763
|
let n = f(e[t]);
|
|
@@ -767,7 +767,7 @@ var H = T({
|
|
|
767
767
|
let r = oe(i[e]);
|
|
768
768
|
t[n] = e, n += 1, t[n] = r.length, n += 1, w(r, t, n, 0, r.length), n += r.length;
|
|
769
769
|
}
|
|
770
|
-
return
|
|
770
|
+
return H.encode.bytes = n - r, t;
|
|
771
771
|
},
|
|
772
772
|
decode(e, t, n) {
|
|
773
773
|
t ||= 0;
|
|
@@ -786,7 +786,7 @@ var H = T({
|
|
|
786
786
|
}
|
|
787
787
|
t += r;
|
|
788
788
|
}
|
|
789
|
-
return
|
|
789
|
+
return H.decode.bytes = t - r, i;
|
|
790
790
|
},
|
|
791
791
|
encodingLength(e) {
|
|
792
792
|
let t = [];
|
|
@@ -798,28 +798,28 @@ var H = T({
|
|
|
798
798
|
for (let e = 0; e < t.length; e++) t[e] !== void 0 && (n += 2 + Math.ceil((t[e] + 1) / 8));
|
|
799
799
|
return n;
|
|
800
800
|
}
|
|
801
|
-
}),
|
|
801
|
+
}), U = T({
|
|
802
802
|
encode(e, t, n) {
|
|
803
|
-
t ||= new Uint8Array(
|
|
803
|
+
t ||= new Uint8Array(U.encodingLength(e)), n ||= 0;
|
|
804
804
|
let r = n;
|
|
805
|
-
return n += 2, E.encode(e.nextDomain, t, n), n += E.encode.bytes,
|
|
805
|
+
return n += 2, E.encode(e.nextDomain, t, n), n += E.encode.bytes, H.encode(e.rrtypes, t, n), n += H.encode.bytes, U.encode.bytes = n - r, C(t, U.encode.bytes - 2, r), t;
|
|
806
806
|
},
|
|
807
807
|
decode(e, t) {
|
|
808
808
|
t ||= 0;
|
|
809
809
|
let n = t, r = {}, i = x(e, t);
|
|
810
|
-
return t += 2, r.nextDomain = E.decode(e, t), t += E.decode.bytes, r.rrtypes =
|
|
810
|
+
return t += 2, r.nextDomain = E.decode(e, t), t += E.decode.bytes, r.rrtypes = H.decode(e, t, i - (t - n)), t += H.decode.bytes, U.decode.bytes = t - n, r;
|
|
811
811
|
},
|
|
812
812
|
encodingLength(e) {
|
|
813
|
-
return 2 + E.encodingLength(e.nextDomain) +
|
|
813
|
+
return 2 + E.encodingLength(e.nextDomain) + H.encodingLength(e.rrtypes);
|
|
814
814
|
}
|
|
815
|
-
}),
|
|
815
|
+
}), W = T({
|
|
816
816
|
encode(e, t, n) {
|
|
817
|
-
t ||= new Uint8Array(
|
|
817
|
+
t ||= new Uint8Array(W.encodingLength(e)), n ||= 0;
|
|
818
818
|
let r = n, i = e.salt;
|
|
819
819
|
if (!v(i)) throw Error("salt must be a Buffer");
|
|
820
820
|
let a = e.nextDomain;
|
|
821
821
|
if (!v(a)) throw Error("nextDomain must be a Buffer");
|
|
822
|
-
return n += 2, t[n] = e.algorithm, n += 1, t[n] = e.flags, n += 1, C(t, e.iterations, n), n += 2, t[n] = i.length, n += 1, w(i, t, n, 0, i.length), n += i.length, t[n] = a.length, n += 1, w(a, t, n, 0, a.length), n += a.length,
|
|
822
|
+
return n += 2, t[n] = e.algorithm, n += 1, t[n] = e.flags, n += 1, C(t, e.iterations, n), n += 2, t[n] = i.length, n += 1, w(i, t, n, 0, i.length), n += i.length, t[n] = a.length, n += 1, w(a, t, n, 0, a.length), n += a.length, H.encode(e.rrtypes, t, n), n += H.encode.bytes, W.encode.bytes = n - r, C(t, W.encode.bytes - 2, r), t;
|
|
823
823
|
},
|
|
824
824
|
decode(e, t) {
|
|
825
825
|
t ||= 0;
|
|
@@ -828,162 +828,160 @@ var H = T({
|
|
|
828
828
|
let a = e[t];
|
|
829
829
|
t += 1, r.salt = e.slice(t, t + a), t += a;
|
|
830
830
|
let o = e[t];
|
|
831
|
-
return t += 1, r.nextDomain = e.slice(t, t + o), t += o, r.rrtypes =
|
|
831
|
+
return t += 1, r.nextDomain = e.slice(t, t + o), t += o, r.rrtypes = H.decode(e, t, i - (t - n)), t += H.decode.bytes, W.decode.bytes = t - n, r;
|
|
832
832
|
},
|
|
833
833
|
encodingLength(e) {
|
|
834
|
-
return 8 + e.salt.length + e.nextDomain.length +
|
|
834
|
+
return 8 + e.salt.length + e.nextDomain.length + H.encodingLength(e.rrtypes);
|
|
835
835
|
}
|
|
836
|
-
}),
|
|
836
|
+
}), G = T({
|
|
837
837
|
encode(e, t, n) {
|
|
838
|
-
t ||= new Uint8Array(
|
|
838
|
+
t ||= new Uint8Array(G.encodingLength(e)), n ||= 0;
|
|
839
839
|
let r = n, i = e.digest;
|
|
840
840
|
if (!v(i)) throw Error("Digest must be a Buffer");
|
|
841
|
-
return n += 2, C(t, e.keyTag, n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.digestType, n += 1, w(i, t, n, 0, i.length), n += i.length,
|
|
841
|
+
return n += 2, C(t, e.keyTag, n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.digestType, n += 1, w(i, t, n, 0, i.length), n += i.length, G.encode.bytes = n - r, C(t, G.encode.bytes - 2, r), t;
|
|
842
842
|
},
|
|
843
843
|
decode(e, t) {
|
|
844
844
|
t ||= 0;
|
|
845
845
|
let n = t, r = {}, i = x(e, t);
|
|
846
|
-
return t += 2, r.keyTag = x(e, t), t += 2, r.algorithm = e[t], t += 1, r.digestType = e[t], t += 1, r.digest = e.slice(t, n + i + 2), t += r.digest.length,
|
|
846
|
+
return t += 2, r.keyTag = x(e, t), t += 2, r.algorithm = e[t], t += 1, r.digestType = e[t], t += 1, r.digest = e.slice(t, n + i + 2), t += r.digest.length, G.decode.bytes = t - n, r;
|
|
847
847
|
},
|
|
848
848
|
encodingLength(e) {
|
|
849
849
|
return 6 + y(e.digest);
|
|
850
850
|
}
|
|
851
851
|
});
|
|
852
|
-
function
|
|
852
|
+
function Ce(e) {
|
|
853
853
|
switch (e.toUpperCase()) {
|
|
854
|
-
case "A": return
|
|
855
|
-
case "PTR": return
|
|
856
|
-
case "CNAME": return
|
|
857
|
-
case "DNAME": return
|
|
858
|
-
case "TXT": return
|
|
859
|
-
case "NULL": return
|
|
860
|
-
case "AAAA": return
|
|
861
|
-
case "SRV": return
|
|
862
|
-
case "HINFO": return
|
|
863
|
-
case "CAA": return
|
|
854
|
+
case "A": return xe;
|
|
855
|
+
case "PTR": return M;
|
|
856
|
+
case "CNAME": return M;
|
|
857
|
+
case "DNAME": return M;
|
|
858
|
+
case "TXT": return ye;
|
|
859
|
+
case "NULL": return be;
|
|
860
|
+
case "AAAA": return I;
|
|
861
|
+
case "SRV": return N;
|
|
862
|
+
case "HINFO": return j;
|
|
863
|
+
case "CAA": return P;
|
|
864
864
|
case "NS": return A;
|
|
865
|
-
case "SOA": return
|
|
866
|
-
case "MX": return
|
|
867
|
-
case "OPT": return
|
|
868
|
-
case "DNSKEY": return
|
|
869
|
-
case "RRSIG": return
|
|
870
|
-
case "RP": return
|
|
871
|
-
case "NSEC": return
|
|
872
|
-
case "NSEC3": return
|
|
873
|
-
case "DS": return
|
|
865
|
+
case "SOA": return ve;
|
|
866
|
+
case "MX": return F;
|
|
867
|
+
case "OPT": return R;
|
|
868
|
+
case "DNSKEY": return z;
|
|
869
|
+
case "RRSIG": return B;
|
|
870
|
+
case "RP": return V;
|
|
871
|
+
case "NSEC": return U;
|
|
872
|
+
case "NSEC3": return W;
|
|
873
|
+
case "DS": return G;
|
|
874
874
|
}
|
|
875
875
|
return k;
|
|
876
876
|
}
|
|
877
|
-
var
|
|
877
|
+
var K = T({
|
|
878
878
|
encode(e, t, n) {
|
|
879
|
-
t ||= new Uint8Array(
|
|
879
|
+
t ||= new Uint8Array(K.encodingLength(e)), n ||= 0;
|
|
880
880
|
let r = n;
|
|
881
881
|
if (E.encode(e.name, t, n), n += E.encode.bytes, C(t, f(e.type), n), e.type.toUpperCase() === "OPT") {
|
|
882
882
|
if (e.name !== ".") throw Error("OPT name must be root.");
|
|
883
|
-
C(t, e.udpPayloadSize || 4096, n + 2), t[n + 4] = e.extendedRcode || 0, t[n + 5] = e.ednsVersion || 0, C(t, e.flags || 0, n + 6), n += 8,
|
|
883
|
+
C(t, e.udpPayloadSize || 4096, n + 2), t[n + 4] = e.extendedRcode || 0, t[n + 5] = e.ednsVersion || 0, C(t, e.flags || 0, n + 6), n += 8, R.encode(e.options || [], t, n), n += R.encode.bytes;
|
|
884
884
|
} else {
|
|
885
885
|
let r = te(e.class === void 0 ? "IN" : e.class);
|
|
886
886
|
e.flush && (r |= me), C(t, r, n + 2), S(t, e.ttl || 0, n + 4), n += 8;
|
|
887
|
-
let i =
|
|
887
|
+
let i = Ce(e.type);
|
|
888
888
|
i.encode(e.data, t, n), n += i.encode.bytes;
|
|
889
889
|
}
|
|
890
|
-
return
|
|
890
|
+
return K.encode.bytes = n - r, t;
|
|
891
891
|
},
|
|
892
892
|
decode(e, t) {
|
|
893
893
|
t ||= 0;
|
|
894
894
|
let n = {}, r = t;
|
|
895
|
-
if (n.name = E.decode(e, t), t += E.decode.bytes, n.type = d(x(e, t)), n.type === "OPT") n.udpPayloadSize = x(e, t + 2), n.extendedRcode = e[t + 4], n.ednsVersion = e[t + 5], n.flags = x(e, t + 6), n.flag_do = (n.flags >> 15 & 1) == 1, n.options =
|
|
895
|
+
if (n.name = E.decode(e, t), t += E.decode.bytes, n.type = d(x(e, t)), n.type === "OPT") n.udpPayloadSize = x(e, t + 2), n.extendedRcode = e[t + 4], n.ednsVersion = e[t + 5], n.flags = x(e, t + 6), n.flag_do = (n.flags >> 15 & 1) == 1, n.options = R.decode(e, t + 8), t += 8 + R.decode.bytes;
|
|
896
896
|
else {
|
|
897
897
|
let r = x(e, t + 2);
|
|
898
898
|
n.ttl = b(e, t + 4), n.class = m(r & he), n.flush = !!(r & me);
|
|
899
|
-
let i =
|
|
899
|
+
let i = Ce(n.type);
|
|
900
900
|
n.data = i.decode(e, t + 8), t += 8 + i.decode.bytes;
|
|
901
901
|
}
|
|
902
|
-
return
|
|
902
|
+
return K.decode.bytes = t - r, n;
|
|
903
903
|
},
|
|
904
904
|
encodingLength(e) {
|
|
905
905
|
let t = e.data !== null && e.data !== void 0 ? e.data : e.options;
|
|
906
|
-
return E.encodingLength(e.name) + 8 +
|
|
906
|
+
return E.encodingLength(e.name) + 8 + Ce(e.type).encodingLength(t);
|
|
907
907
|
}
|
|
908
|
-
}),
|
|
908
|
+
}), q = T({
|
|
909
909
|
encode(e, t, n) {
|
|
910
|
-
t ||= new Uint8Array(
|
|
910
|
+
t ||= new Uint8Array(q.encodingLength(e)), n ||= 0;
|
|
911
911
|
let r = n;
|
|
912
|
-
return E.encode(e.name, t, n), n += E.encode.bytes, C(t, f(e.type), n), n += 2, C(t, te(e.class === void 0 ? "IN" : e.class), n), n += 2,
|
|
912
|
+
return E.encode(e.name, t, n), n += E.encode.bytes, C(t, f(e.type), n), n += 2, C(t, te(e.class === void 0 ? "IN" : e.class), n), n += 2, q.encode.bytes = n - r, e;
|
|
913
913
|
},
|
|
914
914
|
decode(e, t) {
|
|
915
915
|
t ||= 0;
|
|
916
916
|
let n = t, r = {};
|
|
917
|
-
return r.name = E.decode(e, t), t += E.decode.bytes, r.type = d(x(e, t)), t += 2, r.class = m(x(e, t)), t += 2, r.class & ge && (r.class &= _e),
|
|
917
|
+
return r.name = E.decode(e, t), t += E.decode.bytes, r.type = d(x(e, t)), t += 2, r.class = m(x(e, t)), t += 2, r.class & ge && (r.class &= _e), q.decode.bytes = t - n, r;
|
|
918
918
|
},
|
|
919
919
|
encodingLength(e) {
|
|
920
920
|
return E.encodingLength(e.name) + 4;
|
|
921
921
|
}
|
|
922
|
-
}),
|
|
922
|
+
}), J = {
|
|
923
923
|
encode: function(e, t, n) {
|
|
924
924
|
let r = !t;
|
|
925
|
-
r && (t = new Uint8Array(
|
|
925
|
+
r && (t = new Uint8Array(Oe(e))), n ||= 0;
|
|
926
926
|
let i = n;
|
|
927
|
-
return e.questions ||= [], e.answers ||= [], e.authorities ||= [], e.additionals ||= [], O.encode(e, t, n), n += O.encode.bytes, n =
|
|
927
|
+
return e.questions ||= [], e.answers ||= [], e.authorities ||= [], e.additionals ||= [], O.encode(e, t, n), n += O.encode.bytes, n = Z(e.questions, q, t, n), n = Z(e.answers, K, t, n), n = Z(e.authorities, K, t, n), n = Z(e.additionals, K, t, n), J.encode.bytes = n - i, r && Ee.bytes !== t.length ? t.slice(0, Ee.bytes) : t;
|
|
928
928
|
},
|
|
929
929
|
decode: function(e, t) {
|
|
930
930
|
t ||= 0;
|
|
931
931
|
let n = t, r = O.decode(e, t);
|
|
932
|
-
return t += O.decode.bytes, t =
|
|
932
|
+
return t += O.decode.bytes, t = ke(r.questions, q, e, t), t = ke(r.answers, K, e, t), t = ke(r.authorities, K, e, t), t = ke(r.additionals, K, e, t), J.decode.bytes = t - n, r;
|
|
933
933
|
},
|
|
934
934
|
encodingLength: function(e) {
|
|
935
|
-
return O.encodingLength(e) +
|
|
935
|
+
return O.encodingLength(e) + X(e.questions || [], q) + X(e.answers || [], K) + X(e.authorities || [], K) + X(e.additionals || [], K);
|
|
936
936
|
}
|
|
937
937
|
};
|
|
938
|
-
|
|
939
|
-
function
|
|
938
|
+
J.encode.bytes = 0, J.decode.bytes = 0;
|
|
939
|
+
function Y(e, t) {
|
|
940
940
|
if (e.questions) throw Error("Only one .question object expected instead of a .questions array!");
|
|
941
941
|
let n = Object.assign({ type: t }, e);
|
|
942
942
|
return n.question && (n.questions = [n.question], delete n.question), n;
|
|
943
943
|
}
|
|
944
|
-
var
|
|
944
|
+
var we = {
|
|
945
945
|
encode: function(e, t, n) {
|
|
946
|
-
return t =
|
|
946
|
+
return t = J.encode(Y(e, "query"), t, n), we.encode.bytes = J.encode.bytes, t;
|
|
947
947
|
},
|
|
948
948
|
decode: function(e, t) {
|
|
949
|
-
let n =
|
|
950
|
-
return
|
|
949
|
+
let n = J.decode(e, t);
|
|
950
|
+
return we.decode.bytes = J.decode.bytes, n.questions && (n.question = n.questions[0], delete n.questions), n;
|
|
951
951
|
},
|
|
952
952
|
encodingLength: function(e) {
|
|
953
|
-
return
|
|
953
|
+
return J.encodingLength(Y(e, "query"));
|
|
954
954
|
}
|
|
955
955
|
};
|
|
956
|
-
|
|
957
|
-
var
|
|
956
|
+
we.encode.bytes = 0, we.decode.bytes = 0;
|
|
957
|
+
var Te = {
|
|
958
958
|
encode: function(e, t, n) {
|
|
959
|
-
return t =
|
|
959
|
+
return t = J.encode(Y(e, "response"), t, n), Te.encode.bytes = J.encode.bytes, t;
|
|
960
960
|
},
|
|
961
961
|
decode: function(e, t) {
|
|
962
|
-
let n =
|
|
963
|
-
return
|
|
962
|
+
let n = J.decode(e, t);
|
|
963
|
+
return Te.decode.bytes = J.decode.bytes, n.questions && (n.question = n.questions[0], delete n.questions), n;
|
|
964
964
|
},
|
|
965
965
|
encodingLength: function(e) {
|
|
966
|
-
return
|
|
966
|
+
return J.encodingLength(Y(e, "response"));
|
|
967
967
|
}
|
|
968
968
|
};
|
|
969
|
-
|
|
970
|
-
var
|
|
971
|
-
X
|
|
972
|
-
var Ee = X.encodingLength;
|
|
973
|
-
function Z(e, t) {
|
|
969
|
+
Te.encode.bytes = 0, Te.decode.bytes = 0;
|
|
970
|
+
var Ee = J.encode, De = J.decode, Oe = J.encodingLength;
|
|
971
|
+
function X(e, t) {
|
|
974
972
|
let n = 0;
|
|
975
973
|
for (let r = 0; r < e.length; r++) n += t.encodingLength(e[r]);
|
|
976
974
|
return n;
|
|
977
975
|
}
|
|
978
|
-
function
|
|
976
|
+
function Z(e, t, n, r) {
|
|
979
977
|
for (let i = 0; i < e.length; i++) t.encode(e[i], n, r), r += t.encode.bytes;
|
|
980
978
|
return r;
|
|
981
979
|
}
|
|
982
|
-
function
|
|
980
|
+
function ke(e, t, n, r) {
|
|
983
981
|
for (let i = 0; i < e.length; i++) e[i] = t.decode(n, r), r += t.decode.bytes;
|
|
984
982
|
return r;
|
|
985
983
|
}
|
|
986
|
-
function
|
|
984
|
+
function Ae(e, t, n, r) {
|
|
987
985
|
if (t.length !== 64) throw Error(`Charset needs to be 64 characters long! (${t.length})`);
|
|
988
986
|
let i = /* @__PURE__ */ new Uint8Array(256), a = /* @__PURE__ */ new Uint8Array(64);
|
|
989
987
|
for (let e = 0; e < 64; e += 1) {
|
|
@@ -1032,16 +1030,16 @@ function Oe(e, t, n, r) {
|
|
|
1032
1030
|
};
|
|
1033
1031
|
return s;
|
|
1034
1032
|
}
|
|
1035
|
-
|
|
1036
|
-
var
|
|
1033
|
+
Ae("base64", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", "=", 1);
|
|
1034
|
+
var je = Ae("base64-url", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", "=", 2), Me = /* @__PURE__ */ e(((e, t) => {
|
|
1037
1035
|
t.exports = {};
|
|
1038
|
-
})),
|
|
1039
|
-
|
|
1036
|
+
})), Q = typeof global < "u" ? global.AbortError : typeof window < "u" ? window.AbortError : null;
|
|
1037
|
+
Q ||= class extends Error {
|
|
1040
1038
|
constructor(e = "Request aborted.") {
|
|
1041
1039
|
super(e);
|
|
1042
1040
|
}
|
|
1043
|
-
},
|
|
1044
|
-
var
|
|
1041
|
+
}, Q.prototype.name = "AbortError", Q.prototype.code = "ABORT_ERR";
|
|
1042
|
+
var Ne = typeof globalThis < "u" && globalThis.URL || Me().URL, $ = class extends Error {
|
|
1045
1043
|
constructor(e, t, n) {
|
|
1046
1044
|
super("status=" + t + " while requesting " + e + " [" + n + "]"), this.uri = e, this.status = t, this.method = n;
|
|
1047
1045
|
}
|
|
@@ -1056,7 +1054,7 @@ var Me = typeof globalThis < "u" && globalThis.URL || Ae().URL, $ = class extend
|
|
|
1056
1054
|
}
|
|
1057
1055
|
};
|
|
1058
1056
|
$.prototype.name = "HTTPStatusError", $.prototype.code = "HTTP_STATUS";
|
|
1059
|
-
var
|
|
1057
|
+
var Pe = class extends Error {
|
|
1060
1058
|
constructor(e, t) {
|
|
1061
1059
|
super(e), this.cause = t;
|
|
1062
1060
|
}
|
|
@@ -1065,12 +1063,12 @@ var Ne = class extends Error {
|
|
|
1065
1063
|
message: this.message,
|
|
1066
1064
|
endpoint: this.endpoint,
|
|
1067
1065
|
code: this.code,
|
|
1068
|
-
cause:
|
|
1066
|
+
cause: Re(this.cause)
|
|
1069
1067
|
};
|
|
1070
1068
|
}
|
|
1071
1069
|
};
|
|
1072
|
-
|
|
1073
|
-
var
|
|
1070
|
+
Pe.prototype.name = "ResponseError", Pe.prototype.code = "RESPONSE_ERR";
|
|
1071
|
+
var Fe = class extends Error {
|
|
1074
1072
|
constructor(e) {
|
|
1075
1073
|
super("Timeout (t=" + e + ")."), this.timeout = e;
|
|
1076
1074
|
}
|
|
@@ -1082,9 +1080,9 @@ var Pe = class extends Error {
|
|
|
1082
1080
|
};
|
|
1083
1081
|
}
|
|
1084
1082
|
};
|
|
1085
|
-
|
|
1086
|
-
var
|
|
1087
|
-
function
|
|
1083
|
+
Fe.prototype.name = "TimeoutError", Fe.prototype.code = "ETIMEOUT";
|
|
1084
|
+
var Ie = /^((\d{1,3}\.){3,3}\d{1,3})(:(\d{2,5}))?$/, Le = /^((::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?)(:(\d{2,5}))?$/i;
|
|
1085
|
+
function Re(e) {
|
|
1088
1086
|
if (typeof e == "string") return { message: e };
|
|
1089
1087
|
try {
|
|
1090
1088
|
let t = JSON.stringify(e);
|
|
@@ -1093,11 +1091,11 @@ function Le(e) {
|
|
|
1093
1091
|
let t = { message: String(e.message || e) };
|
|
1094
1092
|
return e.code !== void 0 && (t.code = String(e.code)), t;
|
|
1095
1093
|
}
|
|
1096
|
-
var
|
|
1097
|
-
function
|
|
1098
|
-
let t =
|
|
1094
|
+
var ze = /^(([a-z0-9]+:)\/\/)?([^/[\s:]+|\[[^\]]+\])?(:([^/\s]+))?(\/[^\s]*)?(.*)$/, Be = /\[(post|get|((ipv4|ipv6|name)=([^\]]+)))\]/gi, Ve = /\[(((pk|name)=([^\]]+)))\]/gi;
|
|
1095
|
+
function He(e) {
|
|
1096
|
+
let t = ze.exec(e), n = t[2] || "https:", r = t[3], i = t[5], a = t[6], o = t[7];
|
|
1099
1097
|
if (n === "https:" || n === "http:") {
|
|
1100
|
-
let e =
|
|
1098
|
+
let e = Ue(o, Be);
|
|
1101
1099
|
return {
|
|
1102
1100
|
name: e.name,
|
|
1103
1101
|
protocol: n,
|
|
@@ -1110,16 +1108,16 @@ function Ve(e) {
|
|
|
1110
1108
|
};
|
|
1111
1109
|
}
|
|
1112
1110
|
if (n === "udp:" || n === "udp4:" || n === "udp6:") {
|
|
1113
|
-
let t =
|
|
1111
|
+
let t = Ue(o, Ve), a = /^\[(.*)\]$/.exec(r);
|
|
1114
1112
|
if (a && n === "udp4:") throw Error(`Endpoint parsing error: Cannot use ipv6 host with udp4: (endpoint=${e})`);
|
|
1115
1113
|
if (!a && n === "udp6:") throw Error(`Endpoint parsing error: Incorrectly formatted host for udp6: (endpoint=${e})`);
|
|
1116
|
-
return a ? new
|
|
1114
|
+
return a ? new Ye({
|
|
1117
1115
|
protocol: "udp6:",
|
|
1118
1116
|
ipv6: a[1],
|
|
1119
1117
|
port: i,
|
|
1120
1118
|
pk: t.pk,
|
|
1121
1119
|
name: t.name
|
|
1122
|
-
}) : new
|
|
1120
|
+
}) : new Je({
|
|
1123
1121
|
protocol: "udp4:",
|
|
1124
1122
|
ipv4: r,
|
|
1125
1123
|
port: i,
|
|
@@ -1127,9 +1125,9 @@ function Ve(e) {
|
|
|
1127
1125
|
name: t.name
|
|
1128
1126
|
});
|
|
1129
1127
|
}
|
|
1130
|
-
throw new
|
|
1128
|
+
throw new We(n, e);
|
|
1131
1129
|
}
|
|
1132
|
-
function
|
|
1130
|
+
function Ue(e, t) {
|
|
1133
1131
|
t.lastIndex = 0;
|
|
1134
1132
|
let n = {};
|
|
1135
1133
|
for (;;) {
|
|
@@ -1139,9 +1137,9 @@ function He(e, t) {
|
|
|
1139
1137
|
}
|
|
1140
1138
|
return n;
|
|
1141
1139
|
}
|
|
1142
|
-
var
|
|
1140
|
+
var We = class extends Error {
|
|
1143
1141
|
constructor(e, t) {
|
|
1144
|
-
super(`Invalid Endpoint: unsupported protocol "${e}" for endpoint: ${t}, supported protocols: ${
|
|
1142
|
+
super(`Invalid Endpoint: unsupported protocol "${e}" for endpoint: ${t}, supported protocols: ${Ge.join(", ")}`), this.protocol = e, this.endpoint = t;
|
|
1145
1143
|
}
|
|
1146
1144
|
toJSON() {
|
|
1147
1145
|
return {
|
|
@@ -1151,13 +1149,13 @@ var Ue = class extends Error {
|
|
|
1151
1149
|
};
|
|
1152
1150
|
}
|
|
1153
1151
|
};
|
|
1154
|
-
|
|
1155
|
-
var
|
|
1152
|
+
We.prototype.name = "InvalidProtocolError", We.prototype.code = "EPROTOCOL";
|
|
1153
|
+
var Ge = [
|
|
1156
1154
|
"http:",
|
|
1157
1155
|
"https:",
|
|
1158
1156
|
"udp4:",
|
|
1159
1157
|
"udp6:"
|
|
1160
|
-
],
|
|
1158
|
+
], Ke = class {
|
|
1161
1159
|
constructor(e, t) {
|
|
1162
1160
|
this.name = e.name || null, this.protocol = e.protocol;
|
|
1163
1161
|
let n = typeof e.port == "string" ? e.port = parseInt(e.port, 10) : e.port;
|
|
@@ -1168,7 +1166,7 @@ var We = [
|
|
|
1168
1166
|
toJSON() {
|
|
1169
1167
|
return this.toString();
|
|
1170
1168
|
}
|
|
1171
|
-
},
|
|
1169
|
+
}, qe = class extends Ke {
|
|
1172
1170
|
constructor(e) {
|
|
1173
1171
|
super(e, !1), this.pk = e.pk || null;
|
|
1174
1172
|
}
|
|
@@ -1176,66 +1174,69 @@ var We = [
|
|
|
1176
1174
|
let e = this.port === (this.pk ? 443 : 53) ? "" : `:${this.port}`, t = this.pk ? ` [pk=${this.pk}]` : "", n = this.name ? ` [name=${this.name}]` : "";
|
|
1177
1175
|
return `udp://${this.ipv4 || `[${this.ipv6}]`}${e}${t}${n}`;
|
|
1178
1176
|
}
|
|
1179
|
-
},
|
|
1177
|
+
}, Je = class extends qe {
|
|
1180
1178
|
constructor(e) {
|
|
1181
1179
|
if (super(Object.assign({ protocol: "udp4:" }, e)), !e.ipv4 || typeof e.ipv4 != "string") throw Error(`Invalid Endpoint: .ipv4 "${e.ipv4}" needs to be set: ${JSON.stringify(e)}`);
|
|
1182
1180
|
this.ipv4 = e.ipv4;
|
|
1183
1181
|
}
|
|
1184
|
-
},
|
|
1182
|
+
}, Ye = class extends qe {
|
|
1185
1183
|
constructor(e) {
|
|
1186
1184
|
if (super(Object.assign({ protocol: "udp6:" }, e)), !e.ipv6 || typeof e.ipv6 != "string") throw Error(`Invalid Endpoint: .ipv6 "${e.ipv6}" needs to be set: ${JSON.stringify(e)}`);
|
|
1187
1185
|
this.ipv6 = e.ipv6;
|
|
1188
1186
|
}
|
|
1189
1187
|
};
|
|
1190
|
-
function
|
|
1191
|
-
return
|
|
1188
|
+
function Xe(e) {
|
|
1189
|
+
return Le.test(e) && !Ie.test(e) ? `[${e}]` : e;
|
|
1192
1190
|
}
|
|
1193
|
-
var
|
|
1191
|
+
var Ze = class extends Ke {
|
|
1194
1192
|
constructor(e) {
|
|
1195
1193
|
if (super(Object.assign({ protocol: "https:" }, e), !0), e.host || (e.ipv4 && (e.host = e.ipv4), e.ipv6 && (e.host = `[${e.ipv6}]`)), !e.host || typeof e.host != "string") throw Error(`Invalid Endpoint: host "${e.path}" needs to be set: ${JSON.stringify(e)}`);
|
|
1196
1194
|
if (this.host = e.host, this.path = e.path || "/dns-query", this.method = /^post$/i.test(e.method) ? "POST" : "GET", this.ipv4 = e.ipv4, this.ipv6 = e.ipv6, !this.ipv6) {
|
|
1197
|
-
let e =
|
|
1195
|
+
let e = Le.exec(this.host);
|
|
1198
1196
|
e && (this.ipv6 = e[1]);
|
|
1199
1197
|
}
|
|
1200
|
-
this.ipv4 ||
|
|
1201
|
-
let t = `${this.protocol}//${
|
|
1198
|
+
this.ipv4 || Ie.test(this.host) && (this.ipv4 = this.host);
|
|
1199
|
+
let t = `${this.protocol}//${Xe(this.host)}:${this.port}${this.path}`;
|
|
1202
1200
|
try {
|
|
1203
|
-
this.url = new
|
|
1201
|
+
this.url = new Ne(t);
|
|
1204
1202
|
} catch (e) {
|
|
1205
1203
|
throw Error(e.message + ` [${t}]`);
|
|
1206
1204
|
}
|
|
1207
1205
|
}
|
|
1208
1206
|
toString() {
|
|
1209
1207
|
let e = this.protocol === "https:" ? "" : "http://", t = this.port === (this.protocol === "https:" ? 443 : 80) ? "" : `:${this.port}`, n = this.method === "GET" ? "" : " [post]", r = this.path === "/dns-query" ? "" : this.path, i = this.name ? ` [name=${this.name}]` : "", a = this.ipv4 && this.ipv4 !== this.host ? ` [ipv4=${this.ipv4}]` : "", o = this.ipv6 && this.ipv6 !== this.host ? ` [ipv6=${this.ipv6}]` : "";
|
|
1210
|
-
return `${e}${
|
|
1208
|
+
return `${e}${Xe(this.host)}${t}${r}${n}${a}${o}${i}`;
|
|
1211
1209
|
}
|
|
1212
1210
|
};
|
|
1213
|
-
function
|
|
1211
|
+
function Qe(e) {
|
|
1214
1212
|
let t;
|
|
1215
|
-
if (typeof e == "string") t =
|
|
1213
|
+
if (typeof e == "string") t = He(e);
|
|
1216
1214
|
else {
|
|
1217
1215
|
if (typeof e != "object" || !e || Array.isArray(e)) throw Error(`Can not convert ${e} to an endpoint`);
|
|
1218
|
-
if (e instanceof
|
|
1216
|
+
if (e instanceof Ke) return e;
|
|
1219
1217
|
t = e;
|
|
1220
1218
|
}
|
|
1221
1219
|
(t.protocol === null || t.protocol === void 0) && (t.protocol = "https:");
|
|
1222
1220
|
let n = t.protocol;
|
|
1223
|
-
if (n === "udp4:") return new
|
|
1224
|
-
if (n === "udp6:") return new
|
|
1225
|
-
if (n === "https:" || n === "http:") return new
|
|
1226
|
-
throw new
|
|
1221
|
+
if (n === "udp4:") return new Je(t);
|
|
1222
|
+
if (n === "udp6:") return new Ye(t);
|
|
1223
|
+
if (n === "https:" || n === "http:") return new Ze(t);
|
|
1224
|
+
throw new We(n, JSON.stringify(t));
|
|
1227
1225
|
}
|
|
1228
1226
|
//#endregion
|
|
1229
1227
|
//#region node_modules/dns-query/lib.browser.mjs
|
|
1230
|
-
var
|
|
1231
|
-
function
|
|
1232
|
-
|
|
1228
|
+
var $e = "application/dns-message";
|
|
1229
|
+
function et() {}
|
|
1230
|
+
function tt() {
|
|
1231
|
+
throw Error("Only \"doh\" endpoints are supported in the browser");
|
|
1232
|
+
}
|
|
1233
|
+
async function nt(e, t, n, r) {
|
|
1233
1234
|
let i = t ? t.localStoragePrefix + t.name : null;
|
|
1234
1235
|
if (i) try {
|
|
1235
1236
|
let e = JSON.parse(localStorage.getItem(i));
|
|
1236
1237
|
if (e && e.time > t.maxTime) return e;
|
|
1237
1238
|
} catch {}
|
|
1238
|
-
let { data: a } = await
|
|
1239
|
+
let { data: a } = await rt(e, "GET", null, n, r), o = {
|
|
1239
1240
|
time: Date.now(),
|
|
1240
1241
|
data: JSON.parse(_(a))
|
|
1241
1242
|
};
|
|
@@ -1246,14 +1247,14 @@ async function et(e, t, n, r) {
|
|
|
1246
1247
|
}
|
|
1247
1248
|
return o;
|
|
1248
1249
|
}
|
|
1249
|
-
function
|
|
1250
|
+
function rt(e, t, n, r, i) {
|
|
1250
1251
|
return new Promise((a, o) => {
|
|
1251
|
-
let s = new
|
|
1252
|
-
t === "GET" && n && (s.search = "?dns=" +
|
|
1252
|
+
let s = new Ne(e);
|
|
1253
|
+
t === "GET" && n && (s.search = "?dns=" + je.decode(n));
|
|
1253
1254
|
let c = s.toString(), l = new XMLHttpRequest();
|
|
1254
|
-
l.open(t, c, !0), l.setRequestHeader("Accept",
|
|
1255
|
+
l.open(t, c, !0), l.setRequestHeader("Accept", $e), t === "POST" && l.setRequestHeader("Content-Type", $e), l.responseType = "arraybuffer", l.timeout = r, l.ontimeout = u, l.onreadystatechange = f, l.onerror = ee, l.onload = d, t === "POST" ? l.send(n) : l.send(), i && i.addEventListener("abort", m);
|
|
1255
1256
|
function u() {
|
|
1256
|
-
p(new
|
|
1257
|
+
p(new Fe(r));
|
|
1257
1258
|
try {
|
|
1258
1259
|
l.abort();
|
|
1259
1260
|
} catch {}
|
|
@@ -1278,7 +1279,7 @@ function tt(e, t, n, r, i) {
|
|
|
1278
1279
|
}
|
|
1279
1280
|
}
|
|
1280
1281
|
let p = function(e, t) {
|
|
1281
|
-
p =
|
|
1282
|
+
p = et, i && i.removeEventListener("abort", m), a(e ? {
|
|
1282
1283
|
error: e,
|
|
1283
1284
|
response: l
|
|
1284
1285
|
} : {
|
|
@@ -1290,19 +1291,22 @@ function tt(e, t, n, r, i) {
|
|
|
1290
1291
|
p(l.status === 200 ? /* @__PURE__ */ Error("Inexplicable XHR Error") : new $(c, l.status, t));
|
|
1291
1292
|
}
|
|
1292
1293
|
function m() {
|
|
1293
|
-
p(new
|
|
1294
|
+
p(new Q());
|
|
1294
1295
|
try {
|
|
1295
1296
|
l.abort();
|
|
1296
1297
|
} catch {}
|
|
1297
1298
|
}
|
|
1298
1299
|
});
|
|
1299
1300
|
}
|
|
1300
|
-
function
|
|
1301
|
+
function it(e, t, n, r, i) {
|
|
1302
|
+
return rt(e, t, n, r, i);
|
|
1303
|
+
}
|
|
1304
|
+
function at(e) {
|
|
1301
1305
|
return e.filter((e) => e.cors || e.endpoint.cors);
|
|
1302
1306
|
}
|
|
1303
1307
|
//#endregion
|
|
1304
1308
|
//#region node_modules/dns-query/resolvers.mjs
|
|
1305
|
-
var
|
|
1309
|
+
var ot = {
|
|
1306
1310
|
data: [
|
|
1307
1311
|
{
|
|
1308
1312
|
name: "adfree.usableprivacy.net",
|
|
@@ -2502,8 +2506,8 @@ var rt = {
|
|
|
2502
2506
|
};
|
|
2503
2507
|
//#endregion
|
|
2504
2508
|
//#region node_modules/dns-query/index.mjs
|
|
2505
|
-
function
|
|
2506
|
-
let t = e.time === null || e.time === void 0 ? Date.now() : e.time, n =
|
|
2509
|
+
function st(e) {
|
|
2510
|
+
let t = e.time === null || e.time === void 0 ? Date.now() : e.time, n = at(e.data.map((e) => (e.endpoint = Qe(Object.assign({ name: e.name }, e.endpoint)), e))), r = n.map((e) => e.endpoint);
|
|
2507
2511
|
return {
|
|
2508
2512
|
data: {
|
|
2509
2513
|
resolvers: n,
|
|
@@ -2514,8 +2518,31 @@ function it(e) {
|
|
|
2514
2518
|
time: t
|
|
2515
2519
|
};
|
|
2516
2520
|
}
|
|
2517
|
-
var
|
|
2518
|
-
function
|
|
2521
|
+
var ct = st(ot);
|
|
2522
|
+
function lt(e) {
|
|
2523
|
+
let t = Object.assign({ type: "query" }, e);
|
|
2524
|
+
return delete t.question, t.questions = [], e.question && t.questions.push(e.question), t;
|
|
2525
|
+
}
|
|
2526
|
+
function ut(e, t, n, r) {
|
|
2527
|
+
return r && r.aborted ? Promise.reject(new Q()) : e.protocol === "udp4:" || e.protocol === "udp6:" ? tt(e, t, n, r) : dt(e, t, n, r);
|
|
2528
|
+
}
|
|
2529
|
+
function dt(e, t, n, r) {
|
|
2530
|
+
return it(e.url, e.method, Ee(Object.assign({ flags: 256 }, t)), n, r).then(function(e) {
|
|
2531
|
+
let t = e.data, n = e.response, r = e.error;
|
|
2532
|
+
if (r === void 0) {
|
|
2533
|
+
if (t.length === 0) r = new Pe("Empty.");
|
|
2534
|
+
else try {
|
|
2535
|
+
let e = De(t);
|
|
2536
|
+
return e.response = n, e;
|
|
2537
|
+
} catch (e) {
|
|
2538
|
+
r = new Pe("Invalid packet (cause=" + e.message + ")", e);
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
throw Object.assign(r, { response: n });
|
|
2542
|
+
});
|
|
2543
|
+
}
|
|
2544
|
+
var ft = new Ne("https://martinheidegger.github.io/dns-query/resolvers.json");
|
|
2545
|
+
function pt(e) {
|
|
2519
2546
|
return /^@/.test(e);
|
|
2520
2547
|
}
|
|
2521
2548
|
new class {
|
|
@@ -2523,48 +2550,74 @@ new class {
|
|
|
2523
2550
|
this.opts = Object.assign({
|
|
2524
2551
|
timeout: 5e3,
|
|
2525
2552
|
update: !0,
|
|
2526
|
-
updateURL:
|
|
2553
|
+
updateURL: ft,
|
|
2527
2554
|
persist: !1,
|
|
2528
2555
|
localStoragePrefix: "dnsquery_",
|
|
2529
2556
|
maxAge: 3e5
|
|
2530
2557
|
}, e), this._dataP = null;
|
|
2531
2558
|
}
|
|
2532
2559
|
_data(e, t) {
|
|
2533
|
-
return !e && this._dataP !== null ? this._dataP.then((e) => e.time < Date.now() - this.opts.maxAge ? this._data(!0, e) : e) : (this._dataP = this.opts.update ?
|
|
2560
|
+
return !e && this._dataP !== null ? this._dataP.then((e) => e.time < Date.now() - this.opts.maxAge ? this._data(!0, e) : e) : (this._dataP = this.opts.update ? nt(this.opts.updateURL, this.opts.persist ? {
|
|
2534
2561
|
name: "resolvers.json",
|
|
2535
2562
|
localStoragePrefix: this.opts.localStoragePrefix,
|
|
2536
2563
|
maxTime: Date.now() - this.opts.maxAge
|
|
2537
|
-
} : null, this.opts.timeout).then((e) =>
|
|
2564
|
+
} : null, this.opts.timeout).then((e) => st({
|
|
2538
2565
|
data: e.data.resolvers,
|
|
2539
2566
|
time: e.time
|
|
2540
|
-
})).catch(() => t ||
|
|
2567
|
+
})).catch(() => t || ct) : Promise.resolve(ct), this._dataP);
|
|
2541
2568
|
}
|
|
2542
2569
|
data() {
|
|
2543
2570
|
return this._data(!1).then((e) => e.data);
|
|
2544
2571
|
}
|
|
2545
2572
|
endpoints(e) {
|
|
2546
2573
|
if (e == null) return this.data().then((e) => e.endpoints);
|
|
2547
|
-
if (e === "doh" && (e =
|
|
2574
|
+
if (e === "doh" && (e = vt), e === "dns" && (e = yt), typeof e == "function") return this.data().then((t) => t.endpoints.filter(e));
|
|
2548
2575
|
if (typeof e == "string" || typeof e[Symbol.iterator] != "function") return Promise.reject(/* @__PURE__ */ Error(`Endpoints (${e}) needs to be iterable (array).`));
|
|
2549
|
-
if (e = Array.from(e).filter(Boolean), e.findIndex(
|
|
2550
|
-
return Promise.resolve(e.map(
|
|
2576
|
+
if (e = Array.from(e).filter(Boolean), e.findIndex(pt) === -1) try {
|
|
2577
|
+
return Promise.resolve(e.map(Qe));
|
|
2551
2578
|
} catch (e) {
|
|
2552
2579
|
return Promise.reject(e);
|
|
2553
2580
|
}
|
|
2554
2581
|
return this.data().then((t) => e.map((e) => {
|
|
2555
|
-
if (
|
|
2582
|
+
if (pt(e)) {
|
|
2556
2583
|
let n = t.endpointByName[e.substring(1)];
|
|
2557
2584
|
if (!n) throw Error(`Endpoint ${e} is not known.`);
|
|
2558
2585
|
return n;
|
|
2559
2586
|
}
|
|
2560
|
-
return
|
|
2587
|
+
return Qe(e);
|
|
2561
2588
|
}));
|
|
2562
2589
|
}
|
|
2563
2590
|
}();
|
|
2564
|
-
function
|
|
2591
|
+
function mt(e) {
|
|
2592
|
+
return typeof e != "object" || !e ? !1 : typeof e.then == "function";
|
|
2593
|
+
}
|
|
2594
|
+
function ht(e) {
|
|
2595
|
+
return mt(e) ? e : Promise.resolve(e);
|
|
2596
|
+
}
|
|
2597
|
+
function gt(e, t) {
|
|
2598
|
+
return t = Object.assign({
|
|
2599
|
+
retries: 5,
|
|
2600
|
+
timeout: 3e4
|
|
2601
|
+
}, t), e.question ? ht(t.endpoints).then((n) => {
|
|
2602
|
+
if (!Array.isArray(n) || n.length === 0) throw Error("No endpoints defined to lookup dns records.");
|
|
2603
|
+
return _t(n.map(Qe), lt(e), t);
|
|
2604
|
+
}).then((e) => (e.question = e.questions[0], delete e.questions, e)) : Promise.reject(/* @__PURE__ */ Error("To request data you need to specify a .question!"));
|
|
2605
|
+
}
|
|
2606
|
+
function _t(e, t, n) {
|
|
2607
|
+
let r = e.length === 1 ? e[0] : e[Math.floor(Math.random() * e.length) % e.length];
|
|
2608
|
+
return ut(r, t, n.timeout, n.signal).then((e) => (e.endpoint = r.toString(), e), (i) => {
|
|
2609
|
+
if (i.name === "AbortError" || n.retries === 0) throw i.endpoint = r.toString(), i;
|
|
2610
|
+
return n.retries > 0 && --n.retries, _t(e, t, n);
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
function vt(e) {
|
|
2565
2614
|
return e.protocol === "https:" || e.protocol === "http:";
|
|
2566
2615
|
}
|
|
2567
|
-
function
|
|
2616
|
+
function yt(e) {
|
|
2568
2617
|
return e.protocol === "udp4:" || e.protocol === "udp6:";
|
|
2569
2618
|
}
|
|
2570
2619
|
//#endregion
|
|
2620
|
+
//#region src/index.js
|
|
2621
|
+
console.log("Hello World Custom Library!");
|
|
2622
|
+
//#endregion
|
|
2623
|
+
export { gt as query };
|