@streamlayer/sdk-web-anonymous-auth 1.1.45 → 1.1.47
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/lib/cjs/index.js +2773 -27
- package/lib/es/index.js +2772 -26
- package/package.json +6 -5
package/lib/cjs/index.js
CHANGED
|
@@ -3,15 +3,12 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
-
require("@streamlayer/sl-eslib/interactive/interactive.common_pb");
|
|
7
|
-
require("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb");
|
|
8
|
-
const sdkSettings_common_pb = require("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb");
|
|
9
|
-
require("@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb");
|
|
10
|
-
require("@streamlayer/sl-eslib/sports/events/events_pb");
|
|
11
|
-
require("@streamlayer/sl-eslib/sdkSettings/client/client_pb");
|
|
12
|
-
const users_pb = require("@streamlayer/sl-eslib/users/users_pb");
|
|
13
6
|
const jose = require("jose");
|
|
14
|
-
|
|
7
|
+
function getDefaultExportFromCjs(x) {
|
|
8
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
9
|
+
}
|
|
10
|
+
var browser$1 = { exports: {} };
|
|
11
|
+
var process = browser$1.exports = {};
|
|
15
12
|
var cachedSetTimeout;
|
|
16
13
|
var cachedClearTimeout;
|
|
17
14
|
function defaultSetTimout() {
|
|
@@ -167,6 +164,8 @@ process.chdir = function(dir) {
|
|
|
167
164
|
process.umask = function() {
|
|
168
165
|
return 0;
|
|
169
166
|
};
|
|
167
|
+
var browserExports = browser$1.exports;
|
|
168
|
+
const process$1 = /* @__PURE__ */ getDefaultExportFromCjs(browserExports);
|
|
170
169
|
var browser = { exports: {} };
|
|
171
170
|
function tryStringify(o) {
|
|
172
171
|
try {
|
|
@@ -699,24 +698,2768 @@ const logger = pino_1({
|
|
|
699
698
|
});
|
|
700
699
|
const createLogger = (name, options) => logger.child({ name }, options);
|
|
701
700
|
createLogger("event-bus");
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
701
|
+
function protoCamelCase(snakeCase) {
|
|
702
|
+
let capNext = false;
|
|
703
|
+
const b = [];
|
|
704
|
+
for (let i = 0; i < snakeCase.length; i++) {
|
|
705
|
+
let c = snakeCase.charAt(i);
|
|
706
|
+
switch (c) {
|
|
707
|
+
case "_":
|
|
708
|
+
capNext = true;
|
|
709
|
+
break;
|
|
710
|
+
case "0":
|
|
711
|
+
case "1":
|
|
712
|
+
case "2":
|
|
713
|
+
case "3":
|
|
714
|
+
case "4":
|
|
715
|
+
case "5":
|
|
716
|
+
case "6":
|
|
717
|
+
case "7":
|
|
718
|
+
case "8":
|
|
719
|
+
case "9":
|
|
720
|
+
b.push(c);
|
|
721
|
+
capNext = false;
|
|
722
|
+
break;
|
|
723
|
+
default:
|
|
724
|
+
if (capNext) {
|
|
725
|
+
capNext = false;
|
|
726
|
+
c = c.toUpperCase();
|
|
727
|
+
}
|
|
728
|
+
b.push(c);
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return b.join("");
|
|
733
|
+
}
|
|
734
|
+
const reservedObjectProperties = /* @__PURE__ */ new Set([
|
|
735
|
+
// names reserved by JavaScript
|
|
736
|
+
"constructor",
|
|
737
|
+
"toString",
|
|
738
|
+
"toJSON",
|
|
739
|
+
"valueOf"
|
|
740
|
+
]);
|
|
741
|
+
function safeObjectProperty(name) {
|
|
742
|
+
return reservedObjectProperties.has(name) ? name + "$" : name;
|
|
743
|
+
}
|
|
744
|
+
function varint64read() {
|
|
745
|
+
let lowBits = 0;
|
|
746
|
+
let highBits = 0;
|
|
747
|
+
for (let shift = 0; shift < 28; shift += 7) {
|
|
748
|
+
let b = this.buf[this.pos++];
|
|
749
|
+
lowBits |= (b & 127) << shift;
|
|
750
|
+
if ((b & 128) == 0) {
|
|
751
|
+
this.assertBounds();
|
|
752
|
+
return [lowBits, highBits];
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
let middleByte = this.buf[this.pos++];
|
|
756
|
+
lowBits |= (middleByte & 15) << 28;
|
|
757
|
+
highBits = (middleByte & 112) >> 4;
|
|
758
|
+
if ((middleByte & 128) == 0) {
|
|
759
|
+
this.assertBounds();
|
|
760
|
+
return [lowBits, highBits];
|
|
761
|
+
}
|
|
762
|
+
for (let shift = 3; shift <= 31; shift += 7) {
|
|
763
|
+
let b = this.buf[this.pos++];
|
|
764
|
+
highBits |= (b & 127) << shift;
|
|
765
|
+
if ((b & 128) == 0) {
|
|
766
|
+
this.assertBounds();
|
|
767
|
+
return [lowBits, highBits];
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
throw new Error("invalid varint");
|
|
771
|
+
}
|
|
772
|
+
const TWO_PWR_32_DBL = 4294967296;
|
|
773
|
+
function int64FromString(dec) {
|
|
774
|
+
const minus = dec[0] === "-";
|
|
775
|
+
if (minus) {
|
|
776
|
+
dec = dec.slice(1);
|
|
777
|
+
}
|
|
778
|
+
const base = 1e6;
|
|
779
|
+
let lowBits = 0;
|
|
780
|
+
let highBits = 0;
|
|
781
|
+
function add1e6digit(begin, end) {
|
|
782
|
+
const digit1e6 = Number(dec.slice(begin, end));
|
|
783
|
+
highBits *= base;
|
|
784
|
+
lowBits = lowBits * base + digit1e6;
|
|
785
|
+
if (lowBits >= TWO_PWR_32_DBL) {
|
|
786
|
+
highBits = highBits + (lowBits / TWO_PWR_32_DBL | 0);
|
|
787
|
+
lowBits = lowBits % TWO_PWR_32_DBL;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
add1e6digit(-24, -18);
|
|
791
|
+
add1e6digit(-18, -12);
|
|
792
|
+
add1e6digit(-12, -6);
|
|
793
|
+
add1e6digit(-6);
|
|
794
|
+
return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits);
|
|
795
|
+
}
|
|
796
|
+
function int64ToString(lo, hi) {
|
|
797
|
+
let bits = newBits(lo, hi);
|
|
798
|
+
const negative = bits.hi & 2147483648;
|
|
799
|
+
if (negative) {
|
|
800
|
+
bits = negate(bits.lo, bits.hi);
|
|
801
|
+
}
|
|
802
|
+
const result = uInt64ToString(bits.lo, bits.hi);
|
|
803
|
+
return negative ? "-" + result : result;
|
|
804
|
+
}
|
|
805
|
+
function uInt64ToString(lo, hi) {
|
|
806
|
+
({ lo, hi } = toUnsigned(lo, hi));
|
|
807
|
+
if (hi <= 2097151) {
|
|
808
|
+
return String(TWO_PWR_32_DBL * hi + lo);
|
|
809
|
+
}
|
|
810
|
+
const low = lo & 16777215;
|
|
811
|
+
const mid = (lo >>> 24 | hi << 8) & 16777215;
|
|
812
|
+
const high = hi >> 16 & 65535;
|
|
813
|
+
let digitA = low + mid * 6777216 + high * 6710656;
|
|
814
|
+
let digitB = mid + high * 8147497;
|
|
815
|
+
let digitC = high * 2;
|
|
816
|
+
const base = 1e7;
|
|
817
|
+
if (digitA >= base) {
|
|
818
|
+
digitB += Math.floor(digitA / base);
|
|
819
|
+
digitA %= base;
|
|
820
|
+
}
|
|
821
|
+
if (digitB >= base) {
|
|
822
|
+
digitC += Math.floor(digitB / base);
|
|
823
|
+
digitB %= base;
|
|
824
|
+
}
|
|
825
|
+
return digitC.toString() + decimalFrom1e7WithLeadingZeros(digitB) + decimalFrom1e7WithLeadingZeros(digitA);
|
|
826
|
+
}
|
|
827
|
+
function toUnsigned(lo, hi) {
|
|
828
|
+
return { lo: lo >>> 0, hi: hi >>> 0 };
|
|
829
|
+
}
|
|
830
|
+
function newBits(lo, hi) {
|
|
831
|
+
return { lo: lo | 0, hi: hi | 0 };
|
|
832
|
+
}
|
|
833
|
+
function negate(lowBits, highBits) {
|
|
834
|
+
highBits = ~highBits;
|
|
835
|
+
if (lowBits) {
|
|
836
|
+
lowBits = ~lowBits + 1;
|
|
837
|
+
} else {
|
|
838
|
+
highBits += 1;
|
|
839
|
+
}
|
|
840
|
+
return newBits(lowBits, highBits);
|
|
841
|
+
}
|
|
842
|
+
const decimalFrom1e7WithLeadingZeros = (digit1e7) => {
|
|
843
|
+
const partial = String(digit1e7);
|
|
844
|
+
return "0000000".slice(partial.length) + partial;
|
|
845
|
+
};
|
|
846
|
+
function varint32read() {
|
|
847
|
+
let b = this.buf[this.pos++];
|
|
848
|
+
let result = b & 127;
|
|
849
|
+
if ((b & 128) == 0) {
|
|
850
|
+
this.assertBounds();
|
|
851
|
+
return result;
|
|
852
|
+
}
|
|
853
|
+
b = this.buf[this.pos++];
|
|
854
|
+
result |= (b & 127) << 7;
|
|
855
|
+
if ((b & 128) == 0) {
|
|
856
|
+
this.assertBounds();
|
|
857
|
+
return result;
|
|
858
|
+
}
|
|
859
|
+
b = this.buf[this.pos++];
|
|
860
|
+
result |= (b & 127) << 14;
|
|
861
|
+
if ((b & 128) == 0) {
|
|
862
|
+
this.assertBounds();
|
|
863
|
+
return result;
|
|
864
|
+
}
|
|
865
|
+
b = this.buf[this.pos++];
|
|
866
|
+
result |= (b & 127) << 21;
|
|
867
|
+
if ((b & 128) == 0) {
|
|
868
|
+
this.assertBounds();
|
|
869
|
+
return result;
|
|
870
|
+
}
|
|
871
|
+
b = this.buf[this.pos++];
|
|
872
|
+
result |= (b & 15) << 28;
|
|
873
|
+
for (let readBytes = 5; (b & 128) !== 0 && readBytes < 10; readBytes++)
|
|
874
|
+
b = this.buf[this.pos++];
|
|
875
|
+
if ((b & 128) != 0)
|
|
876
|
+
throw new Error("invalid varint");
|
|
877
|
+
this.assertBounds();
|
|
878
|
+
return result >>> 0;
|
|
879
|
+
}
|
|
880
|
+
const protoInt64 = /* @__PURE__ */ makeInt64Support();
|
|
881
|
+
function makeInt64Support() {
|
|
882
|
+
const dv = new DataView(new ArrayBuffer(8));
|
|
883
|
+
const ok = typeof BigInt === "function" && typeof dv.getBigInt64 === "function" && typeof dv.getBigUint64 === "function" && typeof dv.setBigInt64 === "function" && typeof dv.setBigUint64 === "function" && (typeof process$1 != "object" || typeof process$1.env != "object" || process$1.env.BUF_BIGINT_DISABLE !== "1");
|
|
884
|
+
if (ok) {
|
|
885
|
+
const MIN = BigInt("-9223372036854775808"), MAX = BigInt("9223372036854775807"), UMIN = BigInt("0"), UMAX = BigInt("18446744073709551615");
|
|
886
|
+
return {
|
|
887
|
+
zero: BigInt(0),
|
|
888
|
+
supported: true,
|
|
889
|
+
parse(value) {
|
|
890
|
+
const bi = typeof value == "bigint" ? value : BigInt(value);
|
|
891
|
+
if (bi > MAX || bi < MIN) {
|
|
892
|
+
throw new Error(`invalid int64: ${value}`);
|
|
893
|
+
}
|
|
894
|
+
return bi;
|
|
895
|
+
},
|
|
896
|
+
uParse(value) {
|
|
897
|
+
const bi = typeof value == "bigint" ? value : BigInt(value);
|
|
898
|
+
if (bi > UMAX || bi < UMIN) {
|
|
899
|
+
throw new Error(`invalid uint64: ${value}`);
|
|
900
|
+
}
|
|
901
|
+
return bi;
|
|
902
|
+
},
|
|
903
|
+
enc(value) {
|
|
904
|
+
dv.setBigInt64(0, this.parse(value), true);
|
|
905
|
+
return {
|
|
906
|
+
lo: dv.getInt32(0, true),
|
|
907
|
+
hi: dv.getInt32(4, true)
|
|
908
|
+
};
|
|
909
|
+
},
|
|
910
|
+
uEnc(value) {
|
|
911
|
+
dv.setBigInt64(0, this.uParse(value), true);
|
|
912
|
+
return {
|
|
913
|
+
lo: dv.getInt32(0, true),
|
|
914
|
+
hi: dv.getInt32(4, true)
|
|
915
|
+
};
|
|
916
|
+
},
|
|
917
|
+
dec(lo, hi) {
|
|
918
|
+
dv.setInt32(0, lo, true);
|
|
919
|
+
dv.setInt32(4, hi, true);
|
|
920
|
+
return dv.getBigInt64(0, true);
|
|
921
|
+
},
|
|
922
|
+
uDec(lo, hi) {
|
|
923
|
+
dv.setInt32(0, lo, true);
|
|
924
|
+
dv.setInt32(4, hi, true);
|
|
925
|
+
return dv.getBigUint64(0, true);
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
return {
|
|
930
|
+
zero: "0",
|
|
931
|
+
supported: false,
|
|
932
|
+
parse(value) {
|
|
933
|
+
if (typeof value != "string") {
|
|
934
|
+
value = value.toString();
|
|
935
|
+
}
|
|
936
|
+
assertInt64String(value);
|
|
937
|
+
return value;
|
|
938
|
+
},
|
|
939
|
+
uParse(value) {
|
|
940
|
+
if (typeof value != "string") {
|
|
941
|
+
value = value.toString();
|
|
942
|
+
}
|
|
943
|
+
assertUInt64String(value);
|
|
944
|
+
return value;
|
|
945
|
+
},
|
|
946
|
+
enc(value) {
|
|
947
|
+
if (typeof value != "string") {
|
|
948
|
+
value = value.toString();
|
|
949
|
+
}
|
|
950
|
+
assertInt64String(value);
|
|
951
|
+
return int64FromString(value);
|
|
952
|
+
},
|
|
953
|
+
uEnc(value) {
|
|
954
|
+
if (typeof value != "string") {
|
|
955
|
+
value = value.toString();
|
|
956
|
+
}
|
|
957
|
+
assertUInt64String(value);
|
|
958
|
+
return int64FromString(value);
|
|
959
|
+
},
|
|
960
|
+
dec(lo, hi) {
|
|
961
|
+
return int64ToString(lo, hi);
|
|
962
|
+
},
|
|
963
|
+
uDec(lo, hi) {
|
|
964
|
+
return uInt64ToString(lo, hi);
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
function assertInt64String(value) {
|
|
969
|
+
if (!/^-?[0-9]+$/.test(value)) {
|
|
970
|
+
throw new Error("invalid int64: " + value);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
function assertUInt64String(value) {
|
|
974
|
+
if (!/^[0-9]+$/.test(value)) {
|
|
975
|
+
throw new Error("invalid uint64: " + value);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
var ScalarType;
|
|
979
|
+
(function(ScalarType2) {
|
|
980
|
+
ScalarType2[ScalarType2["DOUBLE"] = 1] = "DOUBLE";
|
|
981
|
+
ScalarType2[ScalarType2["FLOAT"] = 2] = "FLOAT";
|
|
982
|
+
ScalarType2[ScalarType2["INT64"] = 3] = "INT64";
|
|
983
|
+
ScalarType2[ScalarType2["UINT64"] = 4] = "UINT64";
|
|
984
|
+
ScalarType2[ScalarType2["INT32"] = 5] = "INT32";
|
|
985
|
+
ScalarType2[ScalarType2["FIXED64"] = 6] = "FIXED64";
|
|
986
|
+
ScalarType2[ScalarType2["FIXED32"] = 7] = "FIXED32";
|
|
987
|
+
ScalarType2[ScalarType2["BOOL"] = 8] = "BOOL";
|
|
988
|
+
ScalarType2[ScalarType2["STRING"] = 9] = "STRING";
|
|
989
|
+
ScalarType2[ScalarType2["BYTES"] = 12] = "BYTES";
|
|
990
|
+
ScalarType2[ScalarType2["UINT32"] = 13] = "UINT32";
|
|
991
|
+
ScalarType2[ScalarType2["SFIXED32"] = 15] = "SFIXED32";
|
|
992
|
+
ScalarType2[ScalarType2["SFIXED64"] = 16] = "SFIXED64";
|
|
993
|
+
ScalarType2[ScalarType2["SINT32"] = 17] = "SINT32";
|
|
994
|
+
ScalarType2[ScalarType2["SINT64"] = 18] = "SINT64";
|
|
995
|
+
})(ScalarType || (ScalarType = {}));
|
|
996
|
+
function scalarZeroValue(type, longAsString) {
|
|
997
|
+
switch (type) {
|
|
998
|
+
case ScalarType.STRING:
|
|
999
|
+
return "";
|
|
1000
|
+
case ScalarType.BOOL:
|
|
1001
|
+
return false;
|
|
1002
|
+
default:
|
|
1003
|
+
return 0;
|
|
1004
|
+
case ScalarType.DOUBLE:
|
|
1005
|
+
case ScalarType.FLOAT:
|
|
1006
|
+
return 0;
|
|
1007
|
+
case ScalarType.INT64:
|
|
1008
|
+
case ScalarType.UINT64:
|
|
1009
|
+
case ScalarType.SFIXED64:
|
|
1010
|
+
case ScalarType.FIXED64:
|
|
1011
|
+
case ScalarType.SINT64:
|
|
1012
|
+
return longAsString ? "0" : protoInt64.zero;
|
|
1013
|
+
case ScalarType.BYTES:
|
|
1014
|
+
return new Uint8Array(0);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
function isScalarZeroValue(type, value) {
|
|
1018
|
+
switch (type) {
|
|
1019
|
+
case ScalarType.BOOL:
|
|
1020
|
+
return value === false;
|
|
1021
|
+
case ScalarType.STRING:
|
|
1022
|
+
return value === "";
|
|
1023
|
+
case ScalarType.BYTES:
|
|
1024
|
+
return value instanceof Uint8Array && !value.byteLength;
|
|
1025
|
+
default:
|
|
1026
|
+
return value == 0;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
const IMPLICIT$2 = 2;
|
|
1030
|
+
const unsafeLocal = Symbol.for("reflect unsafe local");
|
|
1031
|
+
function unsafeOneofCase(target, oneof) {
|
|
1032
|
+
const c = target[oneof.localName].case;
|
|
1033
|
+
if (c === void 0) {
|
|
1034
|
+
return c;
|
|
1035
|
+
}
|
|
1036
|
+
return oneof.fields.find((f) => f.localName === c);
|
|
1037
|
+
}
|
|
1038
|
+
function unsafeIsSet(target, field) {
|
|
1039
|
+
const name = field.localName;
|
|
1040
|
+
if (field.oneof) {
|
|
1041
|
+
return target[field.oneof.localName].case === name;
|
|
1042
|
+
}
|
|
1043
|
+
if (field.presence != IMPLICIT$2) {
|
|
1044
|
+
return target[name] !== void 0 && Object.prototype.hasOwnProperty.call(target, name);
|
|
1045
|
+
}
|
|
1046
|
+
switch (field.fieldKind) {
|
|
1047
|
+
case "list":
|
|
1048
|
+
return target[name].length > 0;
|
|
1049
|
+
case "map":
|
|
1050
|
+
return Object.keys(target[name]).length > 0;
|
|
1051
|
+
case "scalar":
|
|
1052
|
+
return !isScalarZeroValue(field.scalar, target[name]);
|
|
1053
|
+
case "enum":
|
|
1054
|
+
return target[name] !== field.enum.values[0].number;
|
|
1055
|
+
}
|
|
1056
|
+
throw new Error("message field with implicit presence");
|
|
1057
|
+
}
|
|
1058
|
+
function unsafeIsSetExplicit(target, localName) {
|
|
1059
|
+
return Object.prototype.hasOwnProperty.call(target, localName) && target[localName] !== void 0;
|
|
1060
|
+
}
|
|
1061
|
+
function unsafeGet(target, field) {
|
|
1062
|
+
if (field.oneof) {
|
|
1063
|
+
const oneof = target[field.oneof.localName];
|
|
1064
|
+
if (oneof.case === field.localName) {
|
|
1065
|
+
return oneof.value;
|
|
1066
|
+
}
|
|
1067
|
+
return void 0;
|
|
1068
|
+
}
|
|
1069
|
+
return target[field.localName];
|
|
1070
|
+
}
|
|
1071
|
+
function unsafeSet(target, field, value) {
|
|
1072
|
+
if (field.oneof) {
|
|
1073
|
+
target[field.oneof.localName] = {
|
|
1074
|
+
case: field.localName,
|
|
1075
|
+
value
|
|
1076
|
+
};
|
|
1077
|
+
} else {
|
|
1078
|
+
target[field.localName] = value;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
function unsafeClear(target, field) {
|
|
1082
|
+
const name = field.localName;
|
|
1083
|
+
if (field.oneof) {
|
|
1084
|
+
const oneofLocalName = field.oneof.localName;
|
|
1085
|
+
if (target[oneofLocalName].case === name) {
|
|
1086
|
+
target[oneofLocalName] = { case: void 0 };
|
|
1087
|
+
}
|
|
1088
|
+
} else if (field.presence != IMPLICIT$2) {
|
|
1089
|
+
delete target[name];
|
|
1090
|
+
} else {
|
|
1091
|
+
switch (field.fieldKind) {
|
|
1092
|
+
case "map":
|
|
1093
|
+
target[name] = {};
|
|
1094
|
+
break;
|
|
1095
|
+
case "list":
|
|
1096
|
+
target[name] = [];
|
|
1097
|
+
break;
|
|
1098
|
+
case "enum":
|
|
1099
|
+
target[name] = field.enum.values[0].number;
|
|
1100
|
+
break;
|
|
1101
|
+
case "scalar":
|
|
1102
|
+
target[name] = scalarZeroValue(field.scalar, field.longAsString);
|
|
1103
|
+
break;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
function restoreJsonNames(message) {
|
|
1108
|
+
for (const f of message.field) {
|
|
1109
|
+
if (!unsafeIsSetExplicit(f, "jsonName")) {
|
|
1110
|
+
f.jsonName = protoCamelCase(f.name);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
message.nestedType.forEach(restoreJsonNames);
|
|
1114
|
+
}
|
|
1115
|
+
function parseTextFormatEnumValue(descEnum, value) {
|
|
1116
|
+
const enumValue = descEnum.values.find((v) => v.name === value);
|
|
1117
|
+
if (!enumValue) {
|
|
1118
|
+
throw new Error(`cannot parse ${descEnum} default value: ${value}`);
|
|
1119
|
+
}
|
|
1120
|
+
return enumValue.number;
|
|
1121
|
+
}
|
|
1122
|
+
function parseTextFormatScalarValue(type, value) {
|
|
1123
|
+
switch (type) {
|
|
1124
|
+
case ScalarType.STRING:
|
|
1125
|
+
return value;
|
|
1126
|
+
case ScalarType.BYTES: {
|
|
1127
|
+
const u = unescapeBytesDefaultValue(value);
|
|
1128
|
+
if (u === false) {
|
|
1129
|
+
throw new Error(`cannot parse ${ScalarType[type]} default value: ${value}`);
|
|
1130
|
+
}
|
|
1131
|
+
return u;
|
|
1132
|
+
}
|
|
1133
|
+
case ScalarType.INT64:
|
|
1134
|
+
case ScalarType.SFIXED64:
|
|
1135
|
+
case ScalarType.SINT64:
|
|
1136
|
+
return protoInt64.parse(value);
|
|
1137
|
+
case ScalarType.UINT64:
|
|
1138
|
+
case ScalarType.FIXED64:
|
|
1139
|
+
return protoInt64.uParse(value);
|
|
1140
|
+
case ScalarType.DOUBLE:
|
|
1141
|
+
case ScalarType.FLOAT:
|
|
1142
|
+
switch (value) {
|
|
1143
|
+
case "inf":
|
|
1144
|
+
return Number.POSITIVE_INFINITY;
|
|
1145
|
+
case "-inf":
|
|
1146
|
+
return Number.NEGATIVE_INFINITY;
|
|
1147
|
+
case "nan":
|
|
1148
|
+
return Number.NaN;
|
|
1149
|
+
default:
|
|
1150
|
+
return parseFloat(value);
|
|
1151
|
+
}
|
|
1152
|
+
case ScalarType.BOOL:
|
|
1153
|
+
return value === "true";
|
|
1154
|
+
case ScalarType.INT32:
|
|
1155
|
+
case ScalarType.UINT32:
|
|
1156
|
+
case ScalarType.SINT32:
|
|
1157
|
+
case ScalarType.FIXED32:
|
|
1158
|
+
case ScalarType.SFIXED32:
|
|
1159
|
+
return parseInt(value, 10);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
function unescapeBytesDefaultValue(str) {
|
|
1163
|
+
const b = [];
|
|
1164
|
+
const input = {
|
|
1165
|
+
tail: str,
|
|
1166
|
+
c: "",
|
|
1167
|
+
next() {
|
|
1168
|
+
if (this.tail.length == 0) {
|
|
1169
|
+
return false;
|
|
1170
|
+
}
|
|
1171
|
+
this.c = this.tail[0];
|
|
1172
|
+
this.tail = this.tail.substring(1);
|
|
1173
|
+
return true;
|
|
1174
|
+
},
|
|
1175
|
+
take(n) {
|
|
1176
|
+
if (this.tail.length >= n) {
|
|
1177
|
+
const r = this.tail.substring(0, n);
|
|
1178
|
+
this.tail = this.tail.substring(n);
|
|
1179
|
+
return r;
|
|
1180
|
+
}
|
|
1181
|
+
return false;
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1184
|
+
while (input.next()) {
|
|
1185
|
+
switch (input.c) {
|
|
1186
|
+
case "\\":
|
|
1187
|
+
if (input.next()) {
|
|
1188
|
+
switch (input.c) {
|
|
1189
|
+
case "\\":
|
|
1190
|
+
b.push(input.c.charCodeAt(0));
|
|
1191
|
+
break;
|
|
1192
|
+
case "b":
|
|
1193
|
+
b.push(8);
|
|
1194
|
+
break;
|
|
1195
|
+
case "f":
|
|
1196
|
+
b.push(12);
|
|
1197
|
+
break;
|
|
1198
|
+
case "n":
|
|
1199
|
+
b.push(10);
|
|
1200
|
+
break;
|
|
1201
|
+
case "r":
|
|
1202
|
+
b.push(13);
|
|
1203
|
+
break;
|
|
1204
|
+
case "t":
|
|
1205
|
+
b.push(9);
|
|
1206
|
+
break;
|
|
1207
|
+
case "v":
|
|
1208
|
+
b.push(11);
|
|
1209
|
+
break;
|
|
1210
|
+
case "0":
|
|
1211
|
+
case "1":
|
|
1212
|
+
case "2":
|
|
1213
|
+
case "3":
|
|
1214
|
+
case "4":
|
|
1215
|
+
case "5":
|
|
1216
|
+
case "6":
|
|
1217
|
+
case "7": {
|
|
1218
|
+
const s = input.c;
|
|
1219
|
+
const t = input.take(2);
|
|
1220
|
+
if (t === false) {
|
|
1221
|
+
return false;
|
|
1222
|
+
}
|
|
1223
|
+
const n = parseInt(s + t, 8);
|
|
1224
|
+
if (isNaN(n)) {
|
|
1225
|
+
return false;
|
|
1226
|
+
}
|
|
1227
|
+
b.push(n);
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
case "x": {
|
|
1231
|
+
const s = input.c;
|
|
1232
|
+
const t = input.take(2);
|
|
1233
|
+
if (t === false) {
|
|
1234
|
+
return false;
|
|
1235
|
+
}
|
|
1236
|
+
const n = parseInt(s + t, 16);
|
|
1237
|
+
if (isNaN(n)) {
|
|
1238
|
+
return false;
|
|
1239
|
+
}
|
|
1240
|
+
b.push(n);
|
|
1241
|
+
break;
|
|
1242
|
+
}
|
|
1243
|
+
case "u": {
|
|
1244
|
+
const s = input.c;
|
|
1245
|
+
const t = input.take(4);
|
|
1246
|
+
if (t === false) {
|
|
1247
|
+
return false;
|
|
1248
|
+
}
|
|
1249
|
+
const n = parseInt(s + t, 16);
|
|
1250
|
+
if (isNaN(n)) {
|
|
1251
|
+
return false;
|
|
1252
|
+
}
|
|
1253
|
+
const chunk = new Uint8Array(4);
|
|
1254
|
+
const view = new DataView(chunk.buffer);
|
|
1255
|
+
view.setInt32(0, n, true);
|
|
1256
|
+
b.push(chunk[0], chunk[1], chunk[2], chunk[3]);
|
|
1257
|
+
break;
|
|
1258
|
+
}
|
|
1259
|
+
case "U": {
|
|
1260
|
+
const s = input.c;
|
|
1261
|
+
const t = input.take(8);
|
|
1262
|
+
if (t === false) {
|
|
1263
|
+
return false;
|
|
1264
|
+
}
|
|
1265
|
+
const tc = protoInt64.uEnc(s + t);
|
|
1266
|
+
const chunk = new Uint8Array(8);
|
|
1267
|
+
const view = new DataView(chunk.buffer);
|
|
1268
|
+
view.setInt32(0, tc.lo, true);
|
|
1269
|
+
view.setInt32(4, tc.hi, true);
|
|
1270
|
+
b.push(chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], chunk[5], chunk[6], chunk[7]);
|
|
1271
|
+
break;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
break;
|
|
1276
|
+
default:
|
|
1277
|
+
b.push(input.c.charCodeAt(0));
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
return new Uint8Array(b);
|
|
1281
|
+
}
|
|
1282
|
+
function* nestedTypes(desc) {
|
|
1283
|
+
switch (desc.kind) {
|
|
1284
|
+
case "file":
|
|
1285
|
+
for (const message of desc.messages) {
|
|
1286
|
+
yield message;
|
|
1287
|
+
yield* nestedTypes(message);
|
|
1288
|
+
}
|
|
1289
|
+
yield* desc.enums;
|
|
1290
|
+
yield* desc.services;
|
|
1291
|
+
yield* desc.extensions;
|
|
1292
|
+
break;
|
|
1293
|
+
case "message":
|
|
1294
|
+
for (const message of desc.nestedMessages) {
|
|
1295
|
+
yield message;
|
|
1296
|
+
yield* nestedTypes(message);
|
|
1297
|
+
}
|
|
1298
|
+
yield* desc.nestedEnums;
|
|
1299
|
+
yield* desc.nestedExtensions;
|
|
1300
|
+
break;
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
function createFileRegistry(...args) {
|
|
1304
|
+
const registry = createBaseRegistry();
|
|
1305
|
+
if (!args.length) {
|
|
1306
|
+
return registry;
|
|
1307
|
+
}
|
|
1308
|
+
if ("$typeName" in args[0] && args[0].$typeName == "google.protobuf.FileDescriptorSet") {
|
|
1309
|
+
for (const file of args[0].file) {
|
|
1310
|
+
addFile(file, registry);
|
|
1311
|
+
}
|
|
1312
|
+
return registry;
|
|
1313
|
+
}
|
|
1314
|
+
if ("$typeName" in args[0]) {
|
|
1315
|
+
let recurseDeps = function(file) {
|
|
1316
|
+
const deps = [];
|
|
1317
|
+
for (const protoFileName of file.dependency) {
|
|
1318
|
+
if (registry.getFile(protoFileName) != void 0) {
|
|
1319
|
+
continue;
|
|
1320
|
+
}
|
|
1321
|
+
if (seen.has(protoFileName)) {
|
|
1322
|
+
continue;
|
|
1323
|
+
}
|
|
1324
|
+
const dep = resolve(protoFileName);
|
|
1325
|
+
if (!dep) {
|
|
1326
|
+
throw new Error(`Unable to resolve ${protoFileName}, imported by ${file.name}`);
|
|
1327
|
+
}
|
|
1328
|
+
if ("kind" in dep) {
|
|
1329
|
+
registry.addFile(dep, false, true);
|
|
1330
|
+
} else {
|
|
1331
|
+
seen.add(dep.name);
|
|
1332
|
+
deps.push(dep);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return deps.concat(...deps.map(recurseDeps));
|
|
1336
|
+
};
|
|
1337
|
+
const input = args[0];
|
|
1338
|
+
const resolve = args[1];
|
|
1339
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1340
|
+
for (const file of [input, ...recurseDeps(input)].reverse()) {
|
|
1341
|
+
addFile(file, registry);
|
|
1342
|
+
}
|
|
1343
|
+
} else {
|
|
1344
|
+
for (const fileReg of args) {
|
|
1345
|
+
for (const file of fileReg.files) {
|
|
1346
|
+
registry.addFile(file);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
return registry;
|
|
1351
|
+
}
|
|
1352
|
+
function createBaseRegistry() {
|
|
1353
|
+
const types = /* @__PURE__ */ new Map();
|
|
1354
|
+
const extendees = /* @__PURE__ */ new Map();
|
|
1355
|
+
const files = /* @__PURE__ */ new Map();
|
|
1356
|
+
return {
|
|
1357
|
+
kind: "registry",
|
|
1358
|
+
types,
|
|
1359
|
+
extendees,
|
|
1360
|
+
[Symbol.iterator]() {
|
|
1361
|
+
return types.values();
|
|
1362
|
+
},
|
|
1363
|
+
get files() {
|
|
1364
|
+
return files.values();
|
|
1365
|
+
},
|
|
1366
|
+
addFile(file, skipTypes, withDeps) {
|
|
1367
|
+
files.set(file.proto.name, file);
|
|
1368
|
+
if (!skipTypes) {
|
|
1369
|
+
for (const type of nestedTypes(file)) {
|
|
1370
|
+
this.add(type);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
if (withDeps) {
|
|
1374
|
+
for (const f of file.dependencies) {
|
|
1375
|
+
this.addFile(f, skipTypes, withDeps);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
add(desc) {
|
|
1380
|
+
if (desc.kind == "extension") {
|
|
1381
|
+
let numberToExt = extendees.get(desc.extendee.typeName);
|
|
1382
|
+
if (!numberToExt) {
|
|
1383
|
+
extendees.set(desc.extendee.typeName, numberToExt = /* @__PURE__ */ new Map());
|
|
1384
|
+
}
|
|
1385
|
+
numberToExt.set(desc.number, desc);
|
|
1386
|
+
}
|
|
1387
|
+
types.set(desc.typeName, desc);
|
|
1388
|
+
},
|
|
1389
|
+
get(typeName) {
|
|
1390
|
+
return types.get(typeName);
|
|
1391
|
+
},
|
|
1392
|
+
getFile(fileName) {
|
|
1393
|
+
return files.get(fileName);
|
|
1394
|
+
},
|
|
1395
|
+
getMessage(typeName) {
|
|
1396
|
+
const t = types.get(typeName);
|
|
1397
|
+
return (t === null || t === void 0 ? void 0 : t.kind) == "message" ? t : void 0;
|
|
1398
|
+
},
|
|
1399
|
+
getEnum(typeName) {
|
|
1400
|
+
const t = types.get(typeName);
|
|
1401
|
+
return (t === null || t === void 0 ? void 0 : t.kind) == "enum" ? t : void 0;
|
|
1402
|
+
},
|
|
1403
|
+
getExtension(typeName) {
|
|
1404
|
+
const t = types.get(typeName);
|
|
1405
|
+
return (t === null || t === void 0 ? void 0 : t.kind) == "extension" ? t : void 0;
|
|
1406
|
+
},
|
|
1407
|
+
getExtensionFor(extendee, no) {
|
|
1408
|
+
var _a;
|
|
1409
|
+
return (_a = extendees.get(extendee.typeName)) === null || _a === void 0 ? void 0 : _a.get(no);
|
|
1410
|
+
},
|
|
1411
|
+
getService(typeName) {
|
|
1412
|
+
const t = types.get(typeName);
|
|
1413
|
+
return (t === null || t === void 0 ? void 0 : t.kind) == "service" ? t : void 0;
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
const EDITION_PROTO2$1 = 998;
|
|
1418
|
+
const EDITION_PROTO3$1 = 999;
|
|
1419
|
+
const TYPE_STRING = 9;
|
|
1420
|
+
const TYPE_GROUP = 10;
|
|
1421
|
+
const TYPE_MESSAGE = 11;
|
|
1422
|
+
const TYPE_BYTES = 12;
|
|
1423
|
+
const TYPE_ENUM = 14;
|
|
1424
|
+
const LABEL_REPEATED = 3;
|
|
1425
|
+
const LABEL_REQUIRED = 2;
|
|
1426
|
+
const JS_STRING = 1;
|
|
1427
|
+
const IDEMPOTENCY_UNKNOWN = 0;
|
|
1428
|
+
const EXPLICIT = 1;
|
|
1429
|
+
const IMPLICIT$1 = 2;
|
|
1430
|
+
const LEGACY_REQUIRED = 3;
|
|
1431
|
+
const PACKED = 1;
|
|
1432
|
+
const DELIMITED = 2;
|
|
1433
|
+
const OPEN = 1;
|
|
1434
|
+
const featureDefaults = {
|
|
1435
|
+
// EDITION_PROTO2
|
|
1436
|
+
998: {
|
|
1437
|
+
fieldPresence: 1,
|
|
1438
|
+
// EXPLICIT,
|
|
1439
|
+
enumType: 2,
|
|
1440
|
+
// CLOSED,
|
|
1441
|
+
repeatedFieldEncoding: 2,
|
|
1442
|
+
// EXPANDED,
|
|
1443
|
+
utf8Validation: 3,
|
|
1444
|
+
// NONE,
|
|
1445
|
+
messageEncoding: 1,
|
|
1446
|
+
// LENGTH_PREFIXED,
|
|
1447
|
+
jsonFormat: 2,
|
|
1448
|
+
// LEGACY_BEST_EFFORT,
|
|
1449
|
+
enforceNamingStyle: 2
|
|
1450
|
+
// STYLE_LEGACY,
|
|
1451
|
+
},
|
|
1452
|
+
// EDITION_PROTO3
|
|
1453
|
+
999: {
|
|
1454
|
+
fieldPresence: 2,
|
|
1455
|
+
// IMPLICIT,
|
|
1456
|
+
enumType: 1,
|
|
1457
|
+
// OPEN,
|
|
1458
|
+
repeatedFieldEncoding: 1,
|
|
1459
|
+
// PACKED,
|
|
1460
|
+
utf8Validation: 2,
|
|
1461
|
+
// VERIFY,
|
|
1462
|
+
messageEncoding: 1,
|
|
1463
|
+
// LENGTH_PREFIXED,
|
|
1464
|
+
jsonFormat: 1,
|
|
1465
|
+
// ALLOW,
|
|
1466
|
+
enforceNamingStyle: 2
|
|
1467
|
+
// STYLE_LEGACY,
|
|
1468
|
+
},
|
|
1469
|
+
// EDITION_2023
|
|
1470
|
+
1e3: {
|
|
1471
|
+
fieldPresence: 1,
|
|
1472
|
+
// EXPLICIT,
|
|
1473
|
+
enumType: 1,
|
|
1474
|
+
// OPEN,
|
|
1475
|
+
repeatedFieldEncoding: 1,
|
|
1476
|
+
// PACKED,
|
|
1477
|
+
utf8Validation: 2,
|
|
1478
|
+
// VERIFY,
|
|
1479
|
+
messageEncoding: 1,
|
|
1480
|
+
// LENGTH_PREFIXED,
|
|
1481
|
+
jsonFormat: 1,
|
|
1482
|
+
// ALLOW,
|
|
1483
|
+
enforceNamingStyle: 2
|
|
1484
|
+
// STYLE_LEGACY,
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
function addFile(proto, reg) {
|
|
1488
|
+
var _a, _b;
|
|
1489
|
+
const file = {
|
|
1490
|
+
kind: "file",
|
|
1491
|
+
proto,
|
|
1492
|
+
deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
|
|
1493
|
+
edition: getFileEdition(proto),
|
|
1494
|
+
name: proto.name.replace(/\.proto$/, ""),
|
|
1495
|
+
dependencies: findFileDependencies(proto, reg),
|
|
1496
|
+
enums: [],
|
|
1497
|
+
messages: [],
|
|
1498
|
+
extensions: [],
|
|
1499
|
+
services: [],
|
|
1500
|
+
toString() {
|
|
1501
|
+
return `file ${proto.name}`;
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
const mapEntriesStore = /* @__PURE__ */ new Map();
|
|
1505
|
+
const mapEntries = {
|
|
1506
|
+
get(typeName) {
|
|
1507
|
+
return mapEntriesStore.get(typeName);
|
|
1508
|
+
},
|
|
1509
|
+
add(desc) {
|
|
1510
|
+
var _a2;
|
|
1511
|
+
assert(((_a2 = desc.proto.options) === null || _a2 === void 0 ? void 0 : _a2.mapEntry) === true);
|
|
1512
|
+
mapEntriesStore.set(desc.typeName, desc);
|
|
1513
|
+
}
|
|
1514
|
+
};
|
|
1515
|
+
for (const enumProto of proto.enumType) {
|
|
1516
|
+
addEnum(enumProto, file, void 0, reg);
|
|
1517
|
+
}
|
|
1518
|
+
for (const messageProto of proto.messageType) {
|
|
1519
|
+
addMessage(messageProto, file, void 0, reg, mapEntries);
|
|
1520
|
+
}
|
|
1521
|
+
for (const serviceProto of proto.service) {
|
|
1522
|
+
addService(serviceProto, file, reg);
|
|
1523
|
+
}
|
|
1524
|
+
addExtensions(file, reg);
|
|
1525
|
+
for (const mapEntry of mapEntriesStore.values()) {
|
|
1526
|
+
addFields(mapEntry, reg, mapEntries);
|
|
1527
|
+
}
|
|
1528
|
+
for (const message of file.messages) {
|
|
1529
|
+
addFields(message, reg, mapEntries);
|
|
1530
|
+
addExtensions(message, reg);
|
|
1531
|
+
}
|
|
1532
|
+
reg.addFile(file, true);
|
|
1533
|
+
}
|
|
1534
|
+
function addExtensions(desc, reg) {
|
|
1535
|
+
switch (desc.kind) {
|
|
1536
|
+
case "file":
|
|
1537
|
+
for (const proto of desc.proto.extension) {
|
|
1538
|
+
const ext = newField(proto, desc, reg);
|
|
1539
|
+
desc.extensions.push(ext);
|
|
1540
|
+
reg.add(ext);
|
|
1541
|
+
}
|
|
1542
|
+
break;
|
|
1543
|
+
case "message":
|
|
1544
|
+
for (const proto of desc.proto.extension) {
|
|
1545
|
+
const ext = newField(proto, desc, reg);
|
|
1546
|
+
desc.nestedExtensions.push(ext);
|
|
1547
|
+
reg.add(ext);
|
|
1548
|
+
}
|
|
1549
|
+
for (const message of desc.nestedMessages) {
|
|
1550
|
+
addExtensions(message, reg);
|
|
1551
|
+
}
|
|
1552
|
+
break;
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
function addFields(message, reg, mapEntries) {
|
|
1556
|
+
const allOneofs = message.proto.oneofDecl.map((proto) => newOneof(proto, message));
|
|
1557
|
+
const oneofsSeen = /* @__PURE__ */ new Set();
|
|
1558
|
+
for (const proto of message.proto.field) {
|
|
1559
|
+
const oneof = findOneof(proto, allOneofs);
|
|
1560
|
+
const field = newField(proto, message, reg, oneof, mapEntries);
|
|
1561
|
+
message.fields.push(field);
|
|
1562
|
+
message.field[field.localName] = field;
|
|
1563
|
+
if (oneof === void 0) {
|
|
1564
|
+
message.members.push(field);
|
|
1565
|
+
} else {
|
|
1566
|
+
oneof.fields.push(field);
|
|
1567
|
+
if (!oneofsSeen.has(oneof)) {
|
|
1568
|
+
oneofsSeen.add(oneof);
|
|
1569
|
+
message.members.push(oneof);
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
for (const oneof of allOneofs.filter((o) => oneofsSeen.has(o))) {
|
|
1574
|
+
message.oneofs.push(oneof);
|
|
1575
|
+
}
|
|
1576
|
+
for (const child of message.nestedMessages) {
|
|
1577
|
+
addFields(child, reg, mapEntries);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
function addEnum(proto, file, parent, reg) {
|
|
1581
|
+
var _a, _b, _c;
|
|
1582
|
+
const sharedPrefix = findEnumSharedPrefix(proto.name, proto.value);
|
|
1583
|
+
const desc = {
|
|
1584
|
+
kind: "enum",
|
|
1585
|
+
proto,
|
|
1586
|
+
deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
|
|
1587
|
+
file,
|
|
1588
|
+
parent,
|
|
1589
|
+
open: true,
|
|
1590
|
+
name: proto.name,
|
|
1591
|
+
typeName: makeTypeName(proto, parent, file),
|
|
1592
|
+
value: {},
|
|
1593
|
+
values: [],
|
|
1594
|
+
sharedPrefix,
|
|
1595
|
+
toString() {
|
|
1596
|
+
return `enum ${this.typeName}`;
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1599
|
+
desc.open = isEnumOpen(desc);
|
|
1600
|
+
reg.add(desc);
|
|
1601
|
+
proto.value.forEach((proto2) => {
|
|
1602
|
+
var _a2, _b2;
|
|
1603
|
+
const name = proto2.name;
|
|
1604
|
+
desc.values.push(desc.value[proto2.number] = {
|
|
1605
|
+
kind: "enum_value",
|
|
1606
|
+
proto: proto2,
|
|
1607
|
+
deprecated: (_b2 = (_a2 = proto2.options) === null || _a2 === void 0 ? void 0 : _a2.deprecated) !== null && _b2 !== void 0 ? _b2 : false,
|
|
1608
|
+
parent: desc,
|
|
1609
|
+
name,
|
|
1610
|
+
localName: safeObjectProperty(sharedPrefix == void 0 ? name : name.substring(sharedPrefix.length)),
|
|
1611
|
+
number: proto2.number,
|
|
1612
|
+
toString() {
|
|
1613
|
+
return `enum value ${desc.typeName}.${name}`;
|
|
1614
|
+
}
|
|
1615
|
+
});
|
|
1616
|
+
});
|
|
1617
|
+
((_c = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _c !== void 0 ? _c : file.enums).push(desc);
|
|
1618
|
+
}
|
|
1619
|
+
function addMessage(proto, file, parent, reg, mapEntries) {
|
|
1620
|
+
var _a, _b, _c, _d;
|
|
1621
|
+
const desc = {
|
|
1622
|
+
kind: "message",
|
|
1623
|
+
proto,
|
|
1624
|
+
deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
|
|
1625
|
+
file,
|
|
1626
|
+
parent,
|
|
1627
|
+
name: proto.name,
|
|
1628
|
+
typeName: makeTypeName(proto, parent, file),
|
|
1629
|
+
fields: [],
|
|
1630
|
+
field: {},
|
|
1631
|
+
oneofs: [],
|
|
1632
|
+
members: [],
|
|
1633
|
+
nestedEnums: [],
|
|
1634
|
+
nestedMessages: [],
|
|
1635
|
+
nestedExtensions: [],
|
|
1636
|
+
toString() {
|
|
1637
|
+
return `message ${this.typeName}`;
|
|
1638
|
+
}
|
|
1639
|
+
};
|
|
1640
|
+
if (((_c = proto.options) === null || _c === void 0 ? void 0 : _c.mapEntry) === true) {
|
|
1641
|
+
mapEntries.add(desc);
|
|
1642
|
+
} else {
|
|
1643
|
+
((_d = parent === null || parent === void 0 ? void 0 : parent.nestedMessages) !== null && _d !== void 0 ? _d : file.messages).push(desc);
|
|
1644
|
+
reg.add(desc);
|
|
1645
|
+
}
|
|
1646
|
+
for (const enumProto of proto.enumType) {
|
|
1647
|
+
addEnum(enumProto, file, desc, reg);
|
|
1648
|
+
}
|
|
1649
|
+
for (const messageProto of proto.nestedType) {
|
|
1650
|
+
addMessage(messageProto, file, desc, reg, mapEntries);
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
function addService(proto, file, reg) {
|
|
1654
|
+
var _a, _b;
|
|
1655
|
+
const desc = {
|
|
1656
|
+
kind: "service",
|
|
1657
|
+
proto,
|
|
1658
|
+
deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
|
|
1659
|
+
file,
|
|
1660
|
+
name: proto.name,
|
|
1661
|
+
typeName: makeTypeName(proto, void 0, file),
|
|
1662
|
+
methods: [],
|
|
1663
|
+
method: {},
|
|
1664
|
+
toString() {
|
|
1665
|
+
return `service ${this.typeName}`;
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
file.services.push(desc);
|
|
1669
|
+
reg.add(desc);
|
|
1670
|
+
for (const methodProto of proto.method) {
|
|
1671
|
+
const method = newMethod(methodProto, desc, reg);
|
|
1672
|
+
desc.methods.push(method);
|
|
1673
|
+
desc.method[method.localName] = method;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
function newMethod(proto, parent, reg) {
|
|
1677
|
+
var _a, _b, _c, _d;
|
|
1678
|
+
let methodKind;
|
|
1679
|
+
if (proto.clientStreaming && proto.serverStreaming) {
|
|
1680
|
+
methodKind = "bidi_streaming";
|
|
1681
|
+
} else if (proto.clientStreaming) {
|
|
1682
|
+
methodKind = "client_streaming";
|
|
1683
|
+
} else if (proto.serverStreaming) {
|
|
1684
|
+
methodKind = "server_streaming";
|
|
1685
|
+
} else {
|
|
1686
|
+
methodKind = "unary";
|
|
1687
|
+
}
|
|
1688
|
+
const input = reg.getMessage(trimLeadingDot(proto.inputType));
|
|
1689
|
+
const output = reg.getMessage(trimLeadingDot(proto.outputType));
|
|
1690
|
+
assert(input, `invalid MethodDescriptorProto: input_type ${proto.inputType} not found`);
|
|
1691
|
+
assert(output, `invalid MethodDescriptorProto: output_type ${proto.inputType} not found`);
|
|
1692
|
+
const name = proto.name;
|
|
1693
|
+
return {
|
|
1694
|
+
kind: "rpc",
|
|
1695
|
+
proto,
|
|
1696
|
+
deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
|
|
1697
|
+
parent,
|
|
1698
|
+
name,
|
|
1699
|
+
localName: safeObjectProperty(name.length ? safeObjectProperty(name[0].toLowerCase() + name.substring(1)) : name),
|
|
1700
|
+
methodKind,
|
|
1701
|
+
input,
|
|
1702
|
+
output,
|
|
1703
|
+
idempotency: (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.idempotencyLevel) !== null && _d !== void 0 ? _d : IDEMPOTENCY_UNKNOWN,
|
|
1704
|
+
toString() {
|
|
1705
|
+
return `rpc ${parent.typeName}.${name}`;
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
function newOneof(proto, parent) {
|
|
1710
|
+
return {
|
|
1711
|
+
kind: "oneof",
|
|
1712
|
+
proto,
|
|
1713
|
+
deprecated: false,
|
|
1714
|
+
parent,
|
|
1715
|
+
fields: [],
|
|
1716
|
+
name: proto.name,
|
|
1717
|
+
localName: safeObjectProperty(protoCamelCase(proto.name)),
|
|
1718
|
+
toString() {
|
|
1719
|
+
return `oneof ${parent.typeName}.${this.name}`;
|
|
1720
|
+
}
|
|
1721
|
+
};
|
|
1722
|
+
}
|
|
1723
|
+
function newField(proto, parentOrFile, reg, oneof, mapEntries) {
|
|
1724
|
+
var _a, _b, _c;
|
|
1725
|
+
const isExtension = mapEntries === void 0;
|
|
1726
|
+
const field = {
|
|
1727
|
+
kind: "field",
|
|
1728
|
+
proto,
|
|
1729
|
+
deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
|
|
1730
|
+
name: proto.name,
|
|
1731
|
+
number: proto.number,
|
|
1732
|
+
scalar: void 0,
|
|
1733
|
+
message: void 0,
|
|
1734
|
+
enum: void 0,
|
|
1735
|
+
presence: getFieldPresence(proto, oneof, isExtension, parentOrFile),
|
|
1736
|
+
listKind: void 0,
|
|
1737
|
+
mapKind: void 0,
|
|
1738
|
+
mapKey: void 0,
|
|
1739
|
+
delimitedEncoding: void 0,
|
|
1740
|
+
packed: void 0,
|
|
1741
|
+
longAsString: false,
|
|
1742
|
+
getDefaultValue: void 0
|
|
1743
|
+
};
|
|
1744
|
+
if (isExtension) {
|
|
1745
|
+
const file = parentOrFile.kind == "file" ? parentOrFile : parentOrFile.file;
|
|
1746
|
+
const parent = parentOrFile.kind == "file" ? void 0 : parentOrFile;
|
|
1747
|
+
const typeName = makeTypeName(proto, parent, file);
|
|
1748
|
+
field.kind = "extension";
|
|
1749
|
+
field.file = file;
|
|
1750
|
+
field.parent = parent;
|
|
1751
|
+
field.oneof = void 0;
|
|
1752
|
+
field.typeName = typeName;
|
|
1753
|
+
field.jsonName = `[${typeName}]`;
|
|
1754
|
+
field.toString = () => `extension ${typeName}`;
|
|
1755
|
+
const extendee = reg.getMessage(trimLeadingDot(proto.extendee));
|
|
1756
|
+
assert(extendee, `invalid FieldDescriptorProto: extendee ${proto.extendee} not found`);
|
|
1757
|
+
field.extendee = extendee;
|
|
1758
|
+
} else {
|
|
1759
|
+
const parent = parentOrFile;
|
|
1760
|
+
assert(parent.kind == "message");
|
|
1761
|
+
field.parent = parent;
|
|
1762
|
+
field.oneof = oneof;
|
|
1763
|
+
field.localName = oneof ? protoCamelCase(proto.name) : safeObjectProperty(protoCamelCase(proto.name));
|
|
1764
|
+
field.jsonName = proto.jsonName;
|
|
1765
|
+
field.toString = () => `field ${parent.typeName}.${proto.name}`;
|
|
1766
|
+
}
|
|
1767
|
+
const label = proto.label;
|
|
1768
|
+
const type = proto.type;
|
|
1769
|
+
const jstype = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.jstype;
|
|
1770
|
+
if (label === LABEL_REPEATED) {
|
|
1771
|
+
const mapEntry = type == TYPE_MESSAGE ? mapEntries === null || mapEntries === void 0 ? void 0 : mapEntries.get(trimLeadingDot(proto.typeName)) : void 0;
|
|
1772
|
+
if (mapEntry) {
|
|
1773
|
+
field.fieldKind = "map";
|
|
1774
|
+
const { key, value } = findMapEntryFields(mapEntry);
|
|
1775
|
+
field.mapKey = key.scalar;
|
|
1776
|
+
field.mapKind = value.fieldKind;
|
|
1777
|
+
field.message = value.message;
|
|
1778
|
+
field.delimitedEncoding = false;
|
|
1779
|
+
field.enum = value.enum;
|
|
1780
|
+
field.scalar = value.scalar;
|
|
1781
|
+
return field;
|
|
1782
|
+
}
|
|
1783
|
+
field.fieldKind = "list";
|
|
1784
|
+
switch (type) {
|
|
1785
|
+
case TYPE_MESSAGE:
|
|
1786
|
+
case TYPE_GROUP:
|
|
1787
|
+
field.listKind = "message";
|
|
1788
|
+
field.message = reg.getMessage(trimLeadingDot(proto.typeName));
|
|
1789
|
+
assert(field.message);
|
|
1790
|
+
field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
|
|
1791
|
+
break;
|
|
1792
|
+
case TYPE_ENUM:
|
|
1793
|
+
field.listKind = "enum";
|
|
1794
|
+
field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
|
|
1795
|
+
assert(field.enum);
|
|
1796
|
+
break;
|
|
1797
|
+
default:
|
|
1798
|
+
field.listKind = "scalar";
|
|
1799
|
+
field.scalar = type;
|
|
1800
|
+
field.longAsString = jstype == JS_STRING;
|
|
1801
|
+
break;
|
|
1802
|
+
}
|
|
1803
|
+
field.packed = isPackedField(proto, parentOrFile);
|
|
1804
|
+
return field;
|
|
1805
|
+
}
|
|
1806
|
+
switch (type) {
|
|
1807
|
+
case TYPE_MESSAGE:
|
|
1808
|
+
case TYPE_GROUP:
|
|
1809
|
+
field.fieldKind = "message";
|
|
1810
|
+
field.message = reg.getMessage(trimLeadingDot(proto.typeName));
|
|
1811
|
+
assert(
|
|
1812
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
1813
|
+
field.message,
|
|
1814
|
+
`invalid FieldDescriptorProto: type_name ${proto.typeName} not found`
|
|
1815
|
+
);
|
|
1816
|
+
field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
|
|
1817
|
+
field.getDefaultValue = () => void 0;
|
|
1818
|
+
break;
|
|
1819
|
+
case TYPE_ENUM: {
|
|
1820
|
+
const enumeration = reg.getEnum(trimLeadingDot(proto.typeName));
|
|
1821
|
+
assert(enumeration !== void 0, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);
|
|
1822
|
+
field.fieldKind = "enum";
|
|
1823
|
+
field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
|
|
1824
|
+
field.getDefaultValue = () => {
|
|
1825
|
+
return unsafeIsSetExplicit(proto, "defaultValue") ? parseTextFormatEnumValue(enumeration, proto.defaultValue) : void 0;
|
|
1826
|
+
};
|
|
1827
|
+
break;
|
|
1828
|
+
}
|
|
1829
|
+
default: {
|
|
1830
|
+
field.fieldKind = "scalar";
|
|
1831
|
+
field.scalar = type;
|
|
1832
|
+
field.longAsString = jstype == JS_STRING;
|
|
1833
|
+
field.getDefaultValue = () => {
|
|
1834
|
+
return unsafeIsSetExplicit(proto, "defaultValue") ? parseTextFormatScalarValue(type, proto.defaultValue) : void 0;
|
|
1835
|
+
};
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
return field;
|
|
1840
|
+
}
|
|
1841
|
+
function getFileEdition(proto) {
|
|
1842
|
+
switch (proto.syntax) {
|
|
1843
|
+
case "":
|
|
1844
|
+
case "proto2":
|
|
1845
|
+
return EDITION_PROTO2$1;
|
|
1846
|
+
case "proto3":
|
|
1847
|
+
return EDITION_PROTO3$1;
|
|
1848
|
+
case "editions":
|
|
1849
|
+
if (proto.edition in featureDefaults) {
|
|
1850
|
+
return proto.edition;
|
|
1851
|
+
}
|
|
1852
|
+
throw new Error(`${proto.name}: unsupported edition`);
|
|
1853
|
+
default:
|
|
1854
|
+
throw new Error(`${proto.name}: unsupported syntax "${proto.syntax}"`);
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
function findFileDependencies(proto, reg) {
|
|
1858
|
+
return proto.dependency.map((wantName) => {
|
|
1859
|
+
const dep = reg.getFile(wantName);
|
|
1860
|
+
if (!dep) {
|
|
1861
|
+
throw new Error(`Cannot find ${wantName}, imported by ${proto.name}`);
|
|
1862
|
+
}
|
|
1863
|
+
return dep;
|
|
1864
|
+
});
|
|
1865
|
+
}
|
|
1866
|
+
function findEnumSharedPrefix(enumName, values) {
|
|
1867
|
+
const prefix = camelToSnakeCase(enumName) + "_";
|
|
1868
|
+
for (const value of values) {
|
|
1869
|
+
if (!value.name.toLowerCase().startsWith(prefix)) {
|
|
1870
|
+
return void 0;
|
|
1871
|
+
}
|
|
1872
|
+
const shortName = value.name.substring(prefix.length);
|
|
1873
|
+
if (shortName.length == 0) {
|
|
1874
|
+
return void 0;
|
|
1875
|
+
}
|
|
1876
|
+
if (/^\d/.test(shortName)) {
|
|
1877
|
+
return void 0;
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
return prefix;
|
|
1881
|
+
}
|
|
1882
|
+
function camelToSnakeCase(camel) {
|
|
1883
|
+
return (camel.substring(0, 1) + camel.substring(1).replace(/[A-Z]/g, (c) => "_" + c)).toLowerCase();
|
|
1884
|
+
}
|
|
1885
|
+
function makeTypeName(proto, parent, file) {
|
|
1886
|
+
let typeName;
|
|
1887
|
+
if (parent) {
|
|
1888
|
+
typeName = `${parent.typeName}.${proto.name}`;
|
|
1889
|
+
} else if (file.proto.package.length > 0) {
|
|
1890
|
+
typeName = `${file.proto.package}.${proto.name}`;
|
|
1891
|
+
} else {
|
|
1892
|
+
typeName = `${proto.name}`;
|
|
1893
|
+
}
|
|
1894
|
+
return typeName;
|
|
1895
|
+
}
|
|
1896
|
+
function trimLeadingDot(typeName) {
|
|
1897
|
+
return typeName.startsWith(".") ? typeName.substring(1) : typeName;
|
|
1898
|
+
}
|
|
1899
|
+
function findOneof(proto, allOneofs) {
|
|
1900
|
+
if (!unsafeIsSetExplicit(proto, "oneofIndex")) {
|
|
1901
|
+
return void 0;
|
|
1902
|
+
}
|
|
1903
|
+
if (proto.proto3Optional) {
|
|
1904
|
+
return void 0;
|
|
1905
|
+
}
|
|
1906
|
+
const oneof = allOneofs[proto.oneofIndex];
|
|
1907
|
+
assert(
|
|
1908
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
1909
|
+
oneof,
|
|
1910
|
+
`invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`
|
|
1911
|
+
);
|
|
1912
|
+
return oneof;
|
|
1913
|
+
}
|
|
1914
|
+
function getFieldPresence(proto, oneof, isExtension, parent) {
|
|
1915
|
+
if (proto.label == LABEL_REQUIRED) {
|
|
1916
|
+
return LEGACY_REQUIRED;
|
|
1917
|
+
}
|
|
1918
|
+
if (proto.label == LABEL_REPEATED) {
|
|
1919
|
+
return IMPLICIT$1;
|
|
1920
|
+
}
|
|
1921
|
+
if (!!oneof || proto.proto3Optional) {
|
|
1922
|
+
return EXPLICIT;
|
|
1923
|
+
}
|
|
1924
|
+
if (proto.type == TYPE_MESSAGE) {
|
|
1925
|
+
return EXPLICIT;
|
|
1926
|
+
}
|
|
1927
|
+
if (isExtension) {
|
|
1928
|
+
return EXPLICIT;
|
|
1929
|
+
}
|
|
1930
|
+
return resolveFeature("fieldPresence", { proto, parent });
|
|
1931
|
+
}
|
|
1932
|
+
function isPackedField(proto, parent) {
|
|
1933
|
+
if (proto.label != LABEL_REPEATED) {
|
|
1934
|
+
return false;
|
|
1935
|
+
}
|
|
1936
|
+
switch (proto.type) {
|
|
1937
|
+
case TYPE_STRING:
|
|
1938
|
+
case TYPE_BYTES:
|
|
1939
|
+
case TYPE_GROUP:
|
|
1940
|
+
case TYPE_MESSAGE:
|
|
1941
|
+
return false;
|
|
1942
|
+
}
|
|
1943
|
+
const o = proto.options;
|
|
1944
|
+
if (o && unsafeIsSetExplicit(o, "packed")) {
|
|
1945
|
+
return o.packed;
|
|
1946
|
+
}
|
|
1947
|
+
return PACKED == resolveFeature("repeatedFieldEncoding", {
|
|
1948
|
+
proto,
|
|
1949
|
+
parent
|
|
1950
|
+
});
|
|
1951
|
+
}
|
|
1952
|
+
function findMapEntryFields(mapEntry) {
|
|
1953
|
+
const key = mapEntry.fields.find((f) => f.number === 1);
|
|
1954
|
+
const value = mapEntry.fields.find((f) => f.number === 2);
|
|
1955
|
+
assert(key && key.fieldKind == "scalar" && key.scalar != ScalarType.BYTES && key.scalar != ScalarType.FLOAT && key.scalar != ScalarType.DOUBLE && value && value.fieldKind != "list" && value.fieldKind != "map");
|
|
1956
|
+
return { key, value };
|
|
1957
|
+
}
|
|
1958
|
+
function isEnumOpen(desc) {
|
|
1959
|
+
var _a;
|
|
1960
|
+
return OPEN == resolveFeature("enumType", {
|
|
1961
|
+
proto: desc.proto,
|
|
1962
|
+
parent: (_a = desc.parent) !== null && _a !== void 0 ? _a : desc.file
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
function isDelimitedEncoding(proto, parent) {
|
|
1966
|
+
if (proto.type == TYPE_GROUP) {
|
|
1967
|
+
return true;
|
|
1968
|
+
}
|
|
1969
|
+
return DELIMITED == resolveFeature("messageEncoding", {
|
|
1970
|
+
proto,
|
|
1971
|
+
parent
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
function resolveFeature(name, ref) {
|
|
1975
|
+
var _a, _b;
|
|
1976
|
+
const featureSet = (_a = ref.proto.options) === null || _a === void 0 ? void 0 : _a.features;
|
|
1977
|
+
if (featureSet) {
|
|
1978
|
+
const val = featureSet[name];
|
|
1979
|
+
if (val != 0) {
|
|
1980
|
+
return val;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
if ("kind" in ref) {
|
|
1984
|
+
if (ref.kind == "message") {
|
|
1985
|
+
return resolveFeature(name, (_b = ref.parent) !== null && _b !== void 0 ? _b : ref.file);
|
|
1986
|
+
}
|
|
1987
|
+
const editionDefaults = featureDefaults[ref.edition];
|
|
1988
|
+
if (!editionDefaults) {
|
|
1989
|
+
throw new Error(`feature default for edition ${ref.edition} not found`);
|
|
1990
|
+
}
|
|
1991
|
+
return editionDefaults[name];
|
|
1992
|
+
}
|
|
1993
|
+
return resolveFeature(name, ref.parent);
|
|
1994
|
+
}
|
|
1995
|
+
function assert(condition, msg) {
|
|
1996
|
+
if (!condition) {
|
|
1997
|
+
throw new Error(msg);
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
function boot(boot2) {
|
|
2001
|
+
const root = bootFileDescriptorProto(boot2);
|
|
2002
|
+
root.messageType.forEach(restoreJsonNames);
|
|
2003
|
+
const reg = createFileRegistry(root, () => void 0);
|
|
2004
|
+
return reg.getFile(root.name);
|
|
2005
|
+
}
|
|
2006
|
+
function bootFileDescriptorProto(init) {
|
|
2007
|
+
const proto = /* @__PURE__ */ Object.create({
|
|
2008
|
+
syntax: "",
|
|
2009
|
+
edition: 0
|
|
2010
|
+
});
|
|
2011
|
+
return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], service: [], extension: [] }, init), { messageType: init.messageType.map(bootDescriptorProto), enumType: init.enumType.map(bootEnumDescriptorProto) }));
|
|
2012
|
+
}
|
|
2013
|
+
function bootDescriptorProto(init) {
|
|
2014
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2015
|
+
return {
|
|
2016
|
+
$typeName: "google.protobuf.DescriptorProto",
|
|
2017
|
+
name: init.name,
|
|
2018
|
+
field: (_b = (_a = init.field) === null || _a === void 0 ? void 0 : _a.map(bootFieldDescriptorProto)) !== null && _b !== void 0 ? _b : [],
|
|
2019
|
+
extension: [],
|
|
2020
|
+
nestedType: (_d = (_c = init.nestedType) === null || _c === void 0 ? void 0 : _c.map(bootDescriptorProto)) !== null && _d !== void 0 ? _d : [],
|
|
2021
|
+
enumType: (_f = (_e = init.enumType) === null || _e === void 0 ? void 0 : _e.map(bootEnumDescriptorProto)) !== null && _f !== void 0 ? _f : [],
|
|
2022
|
+
extensionRange: (_h = (_g = init.extensionRange) === null || _g === void 0 ? void 0 : _g.map((e) => Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e))) !== null && _h !== void 0 ? _h : [],
|
|
2023
|
+
oneofDecl: [],
|
|
2024
|
+
reservedRange: [],
|
|
2025
|
+
reservedName: []
|
|
2026
|
+
};
|
|
2027
|
+
}
|
|
2028
|
+
function bootFieldDescriptorProto(init) {
|
|
2029
|
+
const proto = /* @__PURE__ */ Object.create({
|
|
2030
|
+
label: 1,
|
|
2031
|
+
typeName: "",
|
|
2032
|
+
extendee: "",
|
|
2033
|
+
defaultValue: "",
|
|
2034
|
+
oneofIndex: 0,
|
|
2035
|
+
jsonName: "",
|
|
2036
|
+
proto3Optional: false
|
|
2037
|
+
});
|
|
2038
|
+
return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, init), { options: init.options ? bootFieldOptions(init.options) : void 0 }));
|
|
2039
|
+
}
|
|
2040
|
+
function bootFieldOptions(init) {
|
|
2041
|
+
var _a, _b, _c;
|
|
2042
|
+
const proto = /* @__PURE__ */ Object.create({
|
|
2043
|
+
ctype: 0,
|
|
2044
|
+
packed: false,
|
|
2045
|
+
jstype: 0,
|
|
2046
|
+
lazy: false,
|
|
2047
|
+
unverifiedLazy: false,
|
|
2048
|
+
deprecated: false,
|
|
2049
|
+
weak: false,
|
|
2050
|
+
debugRedact: false,
|
|
2051
|
+
retention: 0
|
|
2052
|
+
});
|
|
2053
|
+
return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init), { targets: (_a = init.targets) !== null && _a !== void 0 ? _a : [], editionDefaults: (_c = (_b = init.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e) => Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e))) !== null && _c !== void 0 ? _c : [], uninterpretedOption: [] }));
|
|
2054
|
+
}
|
|
2055
|
+
function bootEnumDescriptorProto(init) {
|
|
2056
|
+
return {
|
|
2057
|
+
$typeName: "google.protobuf.EnumDescriptorProto",
|
|
2058
|
+
name: init.name,
|
|
2059
|
+
reservedName: [],
|
|
2060
|
+
reservedRange: [],
|
|
2061
|
+
value: init.value.map((e) => Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e))
|
|
2062
|
+
};
|
|
2063
|
+
}
|
|
2064
|
+
function base64Decode(base64Str) {
|
|
2065
|
+
const table = getDecodeTable();
|
|
2066
|
+
let es = base64Str.length * 3 / 4;
|
|
2067
|
+
if (base64Str[base64Str.length - 2] == "=")
|
|
2068
|
+
es -= 2;
|
|
2069
|
+
else if (base64Str[base64Str.length - 1] == "=")
|
|
2070
|
+
es -= 1;
|
|
2071
|
+
let bytes = new Uint8Array(es), bytePos = 0, groupPos = 0, b, p = 0;
|
|
2072
|
+
for (let i = 0; i < base64Str.length; i++) {
|
|
2073
|
+
b = table[base64Str.charCodeAt(i)];
|
|
2074
|
+
if (b === void 0) {
|
|
2075
|
+
switch (base64Str[i]) {
|
|
2076
|
+
case "=":
|
|
2077
|
+
groupPos = 0;
|
|
2078
|
+
case "\n":
|
|
2079
|
+
case "\r":
|
|
2080
|
+
case " ":
|
|
2081
|
+
case " ":
|
|
2082
|
+
continue;
|
|
2083
|
+
default:
|
|
2084
|
+
throw Error("invalid base64 string");
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
switch (groupPos) {
|
|
2088
|
+
case 0:
|
|
2089
|
+
p = b;
|
|
2090
|
+
groupPos = 1;
|
|
2091
|
+
break;
|
|
2092
|
+
case 1:
|
|
2093
|
+
bytes[bytePos++] = p << 2 | (b & 48) >> 4;
|
|
2094
|
+
p = b;
|
|
2095
|
+
groupPos = 2;
|
|
2096
|
+
break;
|
|
2097
|
+
case 2:
|
|
2098
|
+
bytes[bytePos++] = (p & 15) << 4 | (b & 60) >> 2;
|
|
2099
|
+
p = b;
|
|
2100
|
+
groupPos = 3;
|
|
2101
|
+
break;
|
|
2102
|
+
case 3:
|
|
2103
|
+
bytes[bytePos++] = (p & 3) << 6 | b;
|
|
2104
|
+
groupPos = 0;
|
|
2105
|
+
break;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
if (groupPos == 1)
|
|
2109
|
+
throw Error("invalid base64 string");
|
|
2110
|
+
return bytes.subarray(0, bytePos);
|
|
2111
|
+
}
|
|
2112
|
+
let encodeTableStd;
|
|
2113
|
+
let decodeTable;
|
|
2114
|
+
function getEncodeTable(encoding) {
|
|
2115
|
+
if (!encodeTableStd) {
|
|
2116
|
+
encodeTableStd = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
2117
|
+
encodeTableStd.slice(0, -2).concat("-", "_");
|
|
2118
|
+
}
|
|
2119
|
+
return encodeTableStd;
|
|
2120
|
+
}
|
|
2121
|
+
function getDecodeTable() {
|
|
2122
|
+
if (!decodeTable) {
|
|
2123
|
+
decodeTable = [];
|
|
2124
|
+
const encodeTable = getEncodeTable();
|
|
2125
|
+
for (let i = 0; i < encodeTable.length; i++)
|
|
2126
|
+
decodeTable[encodeTable[i].charCodeAt(0)] = i;
|
|
2127
|
+
decodeTable["-".charCodeAt(0)] = encodeTable.indexOf("+");
|
|
2128
|
+
decodeTable["_".charCodeAt(0)] = encodeTable.indexOf("/");
|
|
2129
|
+
}
|
|
2130
|
+
return decodeTable;
|
|
2131
|
+
}
|
|
2132
|
+
function isMessage(arg, schema) {
|
|
2133
|
+
const isMessage2 = arg !== null && typeof arg == "object" && "$typeName" in arg && typeof arg.$typeName == "string";
|
|
2134
|
+
if (!isMessage2) {
|
|
2135
|
+
return false;
|
|
2136
|
+
}
|
|
2137
|
+
if (schema === void 0) {
|
|
2138
|
+
return true;
|
|
2139
|
+
}
|
|
2140
|
+
return schema.typeName === arg.$typeName;
|
|
2141
|
+
}
|
|
2142
|
+
class FieldError extends Error {
|
|
2143
|
+
constructor(fieldOrOneof, message, name = "FieldValueInvalidError") {
|
|
2144
|
+
super(message);
|
|
2145
|
+
this.name = name;
|
|
2146
|
+
this.field = () => fieldOrOneof;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
function isObject(arg) {
|
|
2150
|
+
return arg !== null && typeof arg == "object" && !Array.isArray(arg);
|
|
2151
|
+
}
|
|
2152
|
+
function isReflectList(arg, field) {
|
|
2153
|
+
var _a, _b, _c, _d;
|
|
2154
|
+
if (isObject(arg) && unsafeLocal in arg && "add" in arg && "field" in arg && typeof arg.field == "function") {
|
|
2155
|
+
if (field !== void 0) {
|
|
2156
|
+
const a = field, b = arg.field();
|
|
2157
|
+
return a.listKind == b.listKind && a.scalar === b.scalar && ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName);
|
|
2158
|
+
}
|
|
2159
|
+
return true;
|
|
2160
|
+
}
|
|
2161
|
+
return false;
|
|
2162
|
+
}
|
|
2163
|
+
function isReflectMap(arg, field) {
|
|
2164
|
+
var _a, _b, _c, _d;
|
|
2165
|
+
if (isObject(arg) && unsafeLocal in arg && "has" in arg && "field" in arg && typeof arg.field == "function") {
|
|
2166
|
+
if (field !== void 0) {
|
|
2167
|
+
const a = field, b = arg.field();
|
|
2168
|
+
return a.mapKey === b.mapKey && a.mapKind == b.mapKind && a.scalar === b.scalar && ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName);
|
|
2169
|
+
}
|
|
2170
|
+
return true;
|
|
2171
|
+
}
|
|
2172
|
+
return false;
|
|
2173
|
+
}
|
|
2174
|
+
function isReflectMessage(arg, messageDesc2) {
|
|
2175
|
+
return isObject(arg) && unsafeLocal in arg && "desc" in arg && isObject(arg.desc) && arg.desc.kind === "message" && (messageDesc2 === void 0 || arg.desc.typeName == messageDesc2.typeName);
|
|
2176
|
+
}
|
|
2177
|
+
const symbol = Symbol.for("@bufbuild/protobuf/text-encoding");
|
|
2178
|
+
function getTextEncoding() {
|
|
2179
|
+
if (globalThis[symbol] == void 0) {
|
|
2180
|
+
const te = new globalThis.TextEncoder();
|
|
2181
|
+
const td = new globalThis.TextDecoder();
|
|
2182
|
+
globalThis[symbol] = {
|
|
2183
|
+
encodeUtf8(text) {
|
|
2184
|
+
return te.encode(text);
|
|
2185
|
+
},
|
|
2186
|
+
decodeUtf8(bytes) {
|
|
2187
|
+
return td.decode(bytes);
|
|
2188
|
+
},
|
|
2189
|
+
checkUtf8(text) {
|
|
2190
|
+
try {
|
|
2191
|
+
encodeURIComponent(text);
|
|
2192
|
+
return true;
|
|
2193
|
+
} catch (e) {
|
|
2194
|
+
return false;
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2199
|
+
return globalThis[symbol];
|
|
2200
|
+
}
|
|
2201
|
+
var WireType;
|
|
2202
|
+
(function(WireType2) {
|
|
2203
|
+
WireType2[WireType2["Varint"] = 0] = "Varint";
|
|
2204
|
+
WireType2[WireType2["Bit64"] = 1] = "Bit64";
|
|
2205
|
+
WireType2[WireType2["LengthDelimited"] = 2] = "LengthDelimited";
|
|
2206
|
+
WireType2[WireType2["StartGroup"] = 3] = "StartGroup";
|
|
2207
|
+
WireType2[WireType2["EndGroup"] = 4] = "EndGroup";
|
|
2208
|
+
WireType2[WireType2["Bit32"] = 5] = "Bit32";
|
|
2209
|
+
})(WireType || (WireType = {}));
|
|
2210
|
+
const FLOAT32_MAX = 34028234663852886e22;
|
|
2211
|
+
const FLOAT32_MIN = -34028234663852886e22;
|
|
2212
|
+
const UINT32_MAX = 4294967295;
|
|
2213
|
+
const INT32_MAX = 2147483647;
|
|
2214
|
+
const INT32_MIN = -2147483648;
|
|
2215
|
+
class BinaryReader {
|
|
2216
|
+
constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) {
|
|
2217
|
+
this.decodeUtf8 = decodeUtf8;
|
|
2218
|
+
this.varint64 = varint64read;
|
|
2219
|
+
this.uint32 = varint32read;
|
|
2220
|
+
this.buf = buf;
|
|
2221
|
+
this.len = buf.length;
|
|
2222
|
+
this.pos = 0;
|
|
2223
|
+
this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
2224
|
+
}
|
|
2225
|
+
/**
|
|
2226
|
+
* Reads a tag - field number and wire type.
|
|
2227
|
+
*/
|
|
2228
|
+
tag() {
|
|
2229
|
+
let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;
|
|
2230
|
+
if (fieldNo <= 0 || wireType < 0 || wireType > 5)
|
|
2231
|
+
throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType);
|
|
2232
|
+
return [fieldNo, wireType];
|
|
2233
|
+
}
|
|
2234
|
+
/**
|
|
2235
|
+
* Skip one element and return the skipped data.
|
|
2236
|
+
*
|
|
2237
|
+
* When skipping StartGroup, provide the tags field number to check for
|
|
2238
|
+
* matching field number in the EndGroup tag.
|
|
2239
|
+
*/
|
|
2240
|
+
skip(wireType, fieldNo) {
|
|
2241
|
+
let start = this.pos;
|
|
2242
|
+
switch (wireType) {
|
|
2243
|
+
case WireType.Varint:
|
|
2244
|
+
while (this.buf[this.pos++] & 128) {
|
|
2245
|
+
}
|
|
2246
|
+
break;
|
|
2247
|
+
case WireType.Bit64:
|
|
2248
|
+
this.pos += 4;
|
|
2249
|
+
case WireType.Bit32:
|
|
2250
|
+
this.pos += 4;
|
|
2251
|
+
break;
|
|
2252
|
+
case WireType.LengthDelimited:
|
|
2253
|
+
let len = this.uint32();
|
|
2254
|
+
this.pos += len;
|
|
2255
|
+
break;
|
|
2256
|
+
case WireType.StartGroup:
|
|
2257
|
+
for (; ; ) {
|
|
2258
|
+
const [fn, wt] = this.tag();
|
|
2259
|
+
if (wt === WireType.EndGroup) {
|
|
2260
|
+
if (fieldNo !== void 0 && fn !== fieldNo) {
|
|
2261
|
+
throw new Error("invalid end group tag");
|
|
2262
|
+
}
|
|
2263
|
+
break;
|
|
2264
|
+
}
|
|
2265
|
+
this.skip(wt, fn);
|
|
2266
|
+
}
|
|
2267
|
+
break;
|
|
2268
|
+
default:
|
|
2269
|
+
throw new Error("cant skip wire type " + wireType);
|
|
2270
|
+
}
|
|
2271
|
+
this.assertBounds();
|
|
2272
|
+
return this.buf.subarray(start, this.pos);
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Throws error if position in byte array is out of range.
|
|
2276
|
+
*/
|
|
2277
|
+
assertBounds() {
|
|
2278
|
+
if (this.pos > this.len)
|
|
2279
|
+
throw new RangeError("premature EOF");
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Read a `int32` field, a signed 32 bit varint.
|
|
2283
|
+
*/
|
|
2284
|
+
int32() {
|
|
2285
|
+
return this.uint32() | 0;
|
|
2286
|
+
}
|
|
2287
|
+
/**
|
|
2288
|
+
* Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.
|
|
2289
|
+
*/
|
|
2290
|
+
sint32() {
|
|
2291
|
+
let zze = this.uint32();
|
|
2292
|
+
return zze >>> 1 ^ -(zze & 1);
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Read a `int64` field, a signed 64-bit varint.
|
|
2296
|
+
*/
|
|
2297
|
+
int64() {
|
|
2298
|
+
return protoInt64.dec(...this.varint64());
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Read a `uint64` field, an unsigned 64-bit varint.
|
|
2302
|
+
*/
|
|
2303
|
+
uint64() {
|
|
2304
|
+
return protoInt64.uDec(...this.varint64());
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
|
|
2308
|
+
*/
|
|
2309
|
+
sint64() {
|
|
2310
|
+
let [lo, hi] = this.varint64();
|
|
2311
|
+
let s = -(lo & 1);
|
|
2312
|
+
lo = (lo >>> 1 | (hi & 1) << 31) ^ s;
|
|
2313
|
+
hi = hi >>> 1 ^ s;
|
|
2314
|
+
return protoInt64.dec(lo, hi);
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Read a `bool` field, a variant.
|
|
2318
|
+
*/
|
|
2319
|
+
bool() {
|
|
2320
|
+
let [lo, hi] = this.varint64();
|
|
2321
|
+
return lo !== 0 || hi !== 0;
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.
|
|
2325
|
+
*/
|
|
2326
|
+
fixed32() {
|
|
2327
|
+
return this.view.getUint32((this.pos += 4) - 4, true);
|
|
2328
|
+
}
|
|
2329
|
+
/**
|
|
2330
|
+
* Read a `sfixed32` field, a signed, fixed-length 32-bit integer.
|
|
2331
|
+
*/
|
|
2332
|
+
sfixed32() {
|
|
2333
|
+
return this.view.getInt32((this.pos += 4) - 4, true);
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.
|
|
2337
|
+
*/
|
|
2338
|
+
fixed64() {
|
|
2339
|
+
return protoInt64.uDec(this.sfixed32(), this.sfixed32());
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Read a `fixed64` field, a signed, fixed-length 64-bit integer.
|
|
2343
|
+
*/
|
|
2344
|
+
sfixed64() {
|
|
2345
|
+
return protoInt64.dec(this.sfixed32(), this.sfixed32());
|
|
2346
|
+
}
|
|
2347
|
+
/**
|
|
2348
|
+
* Read a `float` field, 32-bit floating point number.
|
|
2349
|
+
*/
|
|
2350
|
+
float() {
|
|
2351
|
+
return this.view.getFloat32((this.pos += 4) - 4, true);
|
|
2352
|
+
}
|
|
2353
|
+
/**
|
|
2354
|
+
* Read a `double` field, a 64-bit floating point number.
|
|
2355
|
+
*/
|
|
2356
|
+
double() {
|
|
2357
|
+
return this.view.getFloat64((this.pos += 8) - 8, true);
|
|
2358
|
+
}
|
|
2359
|
+
/**
|
|
2360
|
+
* Read a `bytes` field, length-delimited arbitrary data.
|
|
2361
|
+
*/
|
|
2362
|
+
bytes() {
|
|
2363
|
+
let len = this.uint32(), start = this.pos;
|
|
2364
|
+
this.pos += len;
|
|
2365
|
+
this.assertBounds();
|
|
2366
|
+
return this.buf.subarray(start, start + len);
|
|
2367
|
+
}
|
|
2368
|
+
/**
|
|
2369
|
+
* Read a `string` field, length-delimited data converted to UTF-8 text.
|
|
2370
|
+
*/
|
|
2371
|
+
string() {
|
|
2372
|
+
return this.decodeUtf8(this.bytes());
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
function checkField(field, value) {
|
|
2376
|
+
const check = field.fieldKind == "list" ? isReflectList(value, field) : field.fieldKind == "map" ? isReflectMap(value, field) : checkSingular(field, value);
|
|
2377
|
+
if (check === true) {
|
|
2378
|
+
return void 0;
|
|
2379
|
+
}
|
|
2380
|
+
let reason;
|
|
2381
|
+
switch (field.fieldKind) {
|
|
2382
|
+
case "list":
|
|
2383
|
+
reason = `expected ${formatReflectList(field)}, got ${formatVal(value)}`;
|
|
2384
|
+
break;
|
|
2385
|
+
case "map":
|
|
2386
|
+
reason = `expected ${formatReflectMap(field)}, got ${formatVal(value)}`;
|
|
2387
|
+
break;
|
|
2388
|
+
default: {
|
|
2389
|
+
reason = reasonSingular(field, value, check);
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
return new FieldError(field, reason);
|
|
2393
|
+
}
|
|
2394
|
+
function checkListItem(field, index, value) {
|
|
2395
|
+
const check = checkSingular(field, value);
|
|
2396
|
+
if (check !== true) {
|
|
2397
|
+
return new FieldError(field, `list item #${index + 1}: ${reasonSingular(field, value, check)}`);
|
|
2398
|
+
}
|
|
2399
|
+
return void 0;
|
|
2400
|
+
}
|
|
2401
|
+
function checkMapEntry(field, key, value) {
|
|
2402
|
+
const checkKey = checkScalarValue(key, field.mapKey);
|
|
2403
|
+
if (checkKey !== true) {
|
|
2404
|
+
return new FieldError(field, `invalid map key: ${reasonSingular({ scalar: field.mapKey }, key, checkKey)}`);
|
|
2405
|
+
}
|
|
2406
|
+
const checkVal = checkSingular(field, value);
|
|
2407
|
+
if (checkVal !== true) {
|
|
2408
|
+
return new FieldError(field, `map entry ${formatVal(key)}: ${reasonSingular(field, value, checkVal)}`);
|
|
2409
|
+
}
|
|
2410
|
+
return void 0;
|
|
2411
|
+
}
|
|
2412
|
+
function checkSingular(field, value) {
|
|
2413
|
+
if (field.scalar !== void 0) {
|
|
2414
|
+
return checkScalarValue(value, field.scalar);
|
|
2415
|
+
}
|
|
2416
|
+
if (field.enum !== void 0) {
|
|
2417
|
+
if (field.enum.open) {
|
|
2418
|
+
return Number.isInteger(value);
|
|
2419
|
+
}
|
|
2420
|
+
return field.enum.values.some((v) => v.number === value);
|
|
2421
|
+
}
|
|
2422
|
+
return isReflectMessage(value, field.message);
|
|
2423
|
+
}
|
|
2424
|
+
function checkScalarValue(value, scalar) {
|
|
2425
|
+
switch (scalar) {
|
|
2426
|
+
case ScalarType.DOUBLE:
|
|
2427
|
+
return typeof value == "number";
|
|
2428
|
+
case ScalarType.FLOAT:
|
|
2429
|
+
if (typeof value != "number") {
|
|
2430
|
+
return false;
|
|
2431
|
+
}
|
|
2432
|
+
if (Number.isNaN(value) || !Number.isFinite(value)) {
|
|
2433
|
+
return true;
|
|
2434
|
+
}
|
|
2435
|
+
if (value > FLOAT32_MAX || value < FLOAT32_MIN) {
|
|
2436
|
+
return `${value.toFixed()} out of range`;
|
|
2437
|
+
}
|
|
2438
|
+
return true;
|
|
2439
|
+
case ScalarType.INT32:
|
|
2440
|
+
case ScalarType.SFIXED32:
|
|
2441
|
+
case ScalarType.SINT32:
|
|
2442
|
+
if (typeof value !== "number" || !Number.isInteger(value)) {
|
|
2443
|
+
return false;
|
|
2444
|
+
}
|
|
2445
|
+
if (value > INT32_MAX || value < INT32_MIN) {
|
|
2446
|
+
return `${value.toFixed()} out of range`;
|
|
2447
|
+
}
|
|
2448
|
+
return true;
|
|
2449
|
+
case ScalarType.FIXED32:
|
|
2450
|
+
case ScalarType.UINT32:
|
|
2451
|
+
if (typeof value !== "number" || !Number.isInteger(value)) {
|
|
2452
|
+
return false;
|
|
2453
|
+
}
|
|
2454
|
+
if (value > UINT32_MAX || value < 0) {
|
|
2455
|
+
return `${value.toFixed()} out of range`;
|
|
2456
|
+
}
|
|
2457
|
+
return true;
|
|
2458
|
+
case ScalarType.BOOL:
|
|
2459
|
+
return typeof value == "boolean";
|
|
2460
|
+
case ScalarType.STRING:
|
|
2461
|
+
if (typeof value != "string") {
|
|
2462
|
+
return false;
|
|
2463
|
+
}
|
|
2464
|
+
return getTextEncoding().checkUtf8(value) || "invalid UTF8";
|
|
2465
|
+
case ScalarType.BYTES:
|
|
2466
|
+
return value instanceof Uint8Array;
|
|
2467
|
+
case ScalarType.INT64:
|
|
2468
|
+
case ScalarType.SFIXED64:
|
|
2469
|
+
case ScalarType.SINT64:
|
|
2470
|
+
if (typeof value == "bigint" || typeof value == "number" || typeof value == "string" && value.length > 0) {
|
|
2471
|
+
try {
|
|
2472
|
+
protoInt64.parse(value);
|
|
2473
|
+
return true;
|
|
2474
|
+
} catch (e) {
|
|
2475
|
+
return `${value} out of range`;
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
return false;
|
|
2479
|
+
case ScalarType.FIXED64:
|
|
2480
|
+
case ScalarType.UINT64:
|
|
2481
|
+
if (typeof value == "bigint" || typeof value == "number" || typeof value == "string" && value.length > 0) {
|
|
2482
|
+
try {
|
|
2483
|
+
protoInt64.uParse(value);
|
|
2484
|
+
return true;
|
|
2485
|
+
} catch (e) {
|
|
2486
|
+
return `${value} out of range`;
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
return false;
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
function reasonSingular(field, val, details) {
|
|
2493
|
+
details = typeof details == "string" ? `: ${details}` : `, got ${formatVal(val)}`;
|
|
2494
|
+
if (field.scalar !== void 0) {
|
|
2495
|
+
return `expected ${scalarTypeDescription(field.scalar)}` + details;
|
|
2496
|
+
} else if (field.enum !== void 0) {
|
|
2497
|
+
return `expected ${field.enum.toString()}` + details;
|
|
2498
|
+
}
|
|
2499
|
+
return `expected ${formatReflectMessage(field.message)}` + details;
|
|
2500
|
+
}
|
|
2501
|
+
function formatVal(val) {
|
|
2502
|
+
switch (typeof val) {
|
|
2503
|
+
case "object":
|
|
2504
|
+
if (val === null) {
|
|
2505
|
+
return "null";
|
|
2506
|
+
}
|
|
2507
|
+
if (val instanceof Uint8Array) {
|
|
2508
|
+
return `Uint8Array(${val.length})`;
|
|
2509
|
+
}
|
|
2510
|
+
if (Array.isArray(val)) {
|
|
2511
|
+
return `Array(${val.length})`;
|
|
2512
|
+
}
|
|
2513
|
+
if (isReflectList(val)) {
|
|
2514
|
+
return formatReflectList(val.field());
|
|
2515
|
+
}
|
|
2516
|
+
if (isReflectMap(val)) {
|
|
2517
|
+
return formatReflectMap(val.field());
|
|
2518
|
+
}
|
|
2519
|
+
if (isReflectMessage(val)) {
|
|
2520
|
+
return formatReflectMessage(val.desc);
|
|
2521
|
+
}
|
|
2522
|
+
if (isMessage(val)) {
|
|
2523
|
+
return `message ${val.$typeName}`;
|
|
2524
|
+
}
|
|
2525
|
+
return "object";
|
|
2526
|
+
case "string":
|
|
2527
|
+
return val.length > 30 ? "string" : `"${val.split('"').join('\\"')}"`;
|
|
2528
|
+
case "boolean":
|
|
2529
|
+
return String(val);
|
|
2530
|
+
case "number":
|
|
2531
|
+
return String(val);
|
|
2532
|
+
case "bigint":
|
|
2533
|
+
return String(val) + "n";
|
|
2534
|
+
default:
|
|
2535
|
+
return typeof val;
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
function formatReflectMessage(desc) {
|
|
2539
|
+
return `ReflectMessage (${desc.typeName})`;
|
|
2540
|
+
}
|
|
2541
|
+
function formatReflectList(field) {
|
|
2542
|
+
switch (field.listKind) {
|
|
2543
|
+
case "message":
|
|
2544
|
+
return `ReflectList (${field.message.toString()})`;
|
|
2545
|
+
case "enum":
|
|
2546
|
+
return `ReflectList (${field.enum.toString()})`;
|
|
2547
|
+
case "scalar":
|
|
2548
|
+
return `ReflectList (${ScalarType[field.scalar]})`;
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
function formatReflectMap(field) {
|
|
2552
|
+
switch (field.mapKind) {
|
|
2553
|
+
case "message":
|
|
2554
|
+
return `ReflectMap (${ScalarType[field.mapKey]}, ${field.message.toString()})`;
|
|
2555
|
+
case "enum":
|
|
2556
|
+
return `ReflectMap (${ScalarType[field.mapKey]}, ${field.enum.toString()})`;
|
|
2557
|
+
case "scalar":
|
|
2558
|
+
return `ReflectMap (${ScalarType[field.mapKey]}, ${ScalarType[field.scalar]})`;
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
function scalarTypeDescription(scalar) {
|
|
2562
|
+
switch (scalar) {
|
|
2563
|
+
case ScalarType.STRING:
|
|
2564
|
+
return "string";
|
|
2565
|
+
case ScalarType.BOOL:
|
|
2566
|
+
return "boolean";
|
|
2567
|
+
case ScalarType.INT64:
|
|
2568
|
+
case ScalarType.SINT64:
|
|
2569
|
+
case ScalarType.SFIXED64:
|
|
2570
|
+
return "bigint (int64)";
|
|
2571
|
+
case ScalarType.UINT64:
|
|
2572
|
+
case ScalarType.FIXED64:
|
|
2573
|
+
return "bigint (uint64)";
|
|
2574
|
+
case ScalarType.BYTES:
|
|
2575
|
+
return "Uint8Array";
|
|
2576
|
+
case ScalarType.DOUBLE:
|
|
2577
|
+
return "number (float64)";
|
|
2578
|
+
case ScalarType.FLOAT:
|
|
2579
|
+
return "number (float32)";
|
|
2580
|
+
case ScalarType.FIXED32:
|
|
2581
|
+
case ScalarType.UINT32:
|
|
2582
|
+
return "number (uint32)";
|
|
2583
|
+
case ScalarType.INT32:
|
|
2584
|
+
case ScalarType.SFIXED32:
|
|
2585
|
+
case ScalarType.SINT32:
|
|
2586
|
+
return "number (int32)";
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
function isWrapper(arg) {
|
|
2590
|
+
return isWrapperTypeName(arg.$typeName);
|
|
2591
|
+
}
|
|
2592
|
+
function isWrapperDesc(messageDesc2) {
|
|
2593
|
+
const f = messageDesc2.fields[0];
|
|
2594
|
+
return isWrapperTypeName(messageDesc2.typeName) && f !== void 0 && f.fieldKind == "scalar" && f.name == "value" && f.number == 1;
|
|
2595
|
+
}
|
|
2596
|
+
function isWrapperTypeName(name) {
|
|
2597
|
+
return name.startsWith("google.protobuf.") && [
|
|
2598
|
+
"DoubleValue",
|
|
2599
|
+
"FloatValue",
|
|
2600
|
+
"Int64Value",
|
|
2601
|
+
"UInt64Value",
|
|
2602
|
+
"Int32Value",
|
|
2603
|
+
"UInt32Value",
|
|
2604
|
+
"BoolValue",
|
|
2605
|
+
"StringValue",
|
|
2606
|
+
"BytesValue"
|
|
2607
|
+
].includes(name.substring(16));
|
|
2608
|
+
}
|
|
2609
|
+
const EDITION_PROTO3 = 999;
|
|
2610
|
+
const EDITION_PROTO2 = 998;
|
|
2611
|
+
const IMPLICIT = 2;
|
|
2612
|
+
function create(schema, init) {
|
|
2613
|
+
if (isMessage(init, schema)) {
|
|
2614
|
+
return init;
|
|
2615
|
+
}
|
|
2616
|
+
const message = createZeroMessage(schema);
|
|
2617
|
+
return message;
|
|
2618
|
+
}
|
|
2619
|
+
const tokenZeroMessageField = Symbol();
|
|
2620
|
+
const messagePrototypes = /* @__PURE__ */ new WeakMap();
|
|
2621
|
+
function createZeroMessage(desc) {
|
|
2622
|
+
let msg;
|
|
2623
|
+
if (!needsPrototypeChain(desc)) {
|
|
2624
|
+
msg = {
|
|
2625
|
+
$typeName: desc.typeName
|
|
2626
|
+
};
|
|
2627
|
+
for (const member of desc.members) {
|
|
2628
|
+
if (member.kind == "oneof" || member.presence == IMPLICIT) {
|
|
2629
|
+
msg[member.localName] = createZeroField(member);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
} else {
|
|
2633
|
+
const cached = messagePrototypes.get(desc);
|
|
2634
|
+
let prototype;
|
|
2635
|
+
let members;
|
|
2636
|
+
if (cached) {
|
|
2637
|
+
({ prototype, members } = cached);
|
|
2638
|
+
} else {
|
|
2639
|
+
prototype = {};
|
|
2640
|
+
members = /* @__PURE__ */ new Set();
|
|
2641
|
+
for (const member of desc.members) {
|
|
2642
|
+
if (member.kind == "oneof") {
|
|
2643
|
+
continue;
|
|
2644
|
+
}
|
|
2645
|
+
if (member.fieldKind != "scalar" && member.fieldKind != "enum") {
|
|
2646
|
+
continue;
|
|
2647
|
+
}
|
|
2648
|
+
if (member.presence == IMPLICIT) {
|
|
2649
|
+
continue;
|
|
2650
|
+
}
|
|
2651
|
+
members.add(member);
|
|
2652
|
+
prototype[member.localName] = createZeroField(member);
|
|
2653
|
+
}
|
|
2654
|
+
messagePrototypes.set(desc, { prototype, members });
|
|
2655
|
+
}
|
|
2656
|
+
msg = Object.create(prototype);
|
|
2657
|
+
msg.$typeName = desc.typeName;
|
|
2658
|
+
for (const member of desc.members) {
|
|
2659
|
+
if (members.has(member)) {
|
|
2660
|
+
continue;
|
|
2661
|
+
}
|
|
2662
|
+
if (member.kind == "field") {
|
|
2663
|
+
if (member.fieldKind == "message") {
|
|
2664
|
+
continue;
|
|
2665
|
+
}
|
|
2666
|
+
if (member.fieldKind == "scalar" || member.fieldKind == "enum") {
|
|
2667
|
+
if (member.presence != IMPLICIT) {
|
|
2668
|
+
continue;
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
msg[member.localName] = createZeroField(member);
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
return msg;
|
|
2676
|
+
}
|
|
2677
|
+
function needsPrototypeChain(desc) {
|
|
2678
|
+
switch (desc.file.edition) {
|
|
2679
|
+
case EDITION_PROTO3:
|
|
2680
|
+
return false;
|
|
2681
|
+
case EDITION_PROTO2:
|
|
2682
|
+
return true;
|
|
2683
|
+
default:
|
|
2684
|
+
return desc.fields.some((f) => f.presence != IMPLICIT && f.fieldKind != "message" && !f.oneof);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
function createZeroField(field) {
|
|
2688
|
+
if (field.kind == "oneof") {
|
|
2689
|
+
return { case: void 0 };
|
|
2690
|
+
}
|
|
2691
|
+
if (field.fieldKind == "list") {
|
|
2692
|
+
return [];
|
|
2693
|
+
}
|
|
2694
|
+
if (field.fieldKind == "map") {
|
|
2695
|
+
return {};
|
|
2696
|
+
}
|
|
2697
|
+
if (field.fieldKind == "message") {
|
|
2698
|
+
return tokenZeroMessageField;
|
|
2699
|
+
}
|
|
2700
|
+
const defaultValue = field.getDefaultValue();
|
|
2701
|
+
if (defaultValue !== void 0) {
|
|
2702
|
+
return field.fieldKind == "scalar" && field.longAsString ? defaultValue.toString() : defaultValue;
|
|
2703
|
+
}
|
|
2704
|
+
return field.fieldKind == "scalar" ? scalarZeroValue(field.scalar, field.longAsString) : field.enum.values[0].number;
|
|
2705
|
+
}
|
|
2706
|
+
function reflect(messageDesc2, message, check = true) {
|
|
2707
|
+
return new ReflectMessageImpl(messageDesc2, message, check);
|
|
2708
|
+
}
|
|
2709
|
+
class ReflectMessageImpl {
|
|
2710
|
+
get sortedFields() {
|
|
2711
|
+
var _a;
|
|
2712
|
+
return (_a = this._sortedFields) !== null && _a !== void 0 ? _a : this._sortedFields = this.desc.fields.concat().sort((a, b) => a.number - b.number);
|
|
2713
|
+
}
|
|
2714
|
+
constructor(messageDesc2, message, check = true) {
|
|
2715
|
+
this.lists = /* @__PURE__ */ new Map();
|
|
2716
|
+
this.maps = /* @__PURE__ */ new Map();
|
|
2717
|
+
this.check = check;
|
|
2718
|
+
this.desc = messageDesc2;
|
|
2719
|
+
this.message = this[unsafeLocal] = message !== null && message !== void 0 ? message : create(messageDesc2);
|
|
2720
|
+
this.fields = messageDesc2.fields;
|
|
2721
|
+
this.oneofs = messageDesc2.oneofs;
|
|
2722
|
+
this.members = messageDesc2.members;
|
|
2723
|
+
}
|
|
2724
|
+
findNumber(number) {
|
|
2725
|
+
if (!this._fieldsByNumber) {
|
|
2726
|
+
this._fieldsByNumber = new Map(this.desc.fields.map((f) => [f.number, f]));
|
|
2727
|
+
}
|
|
2728
|
+
return this._fieldsByNumber.get(number);
|
|
2729
|
+
}
|
|
2730
|
+
oneofCase(oneof) {
|
|
2731
|
+
assertOwn(this.message, oneof);
|
|
2732
|
+
return unsafeOneofCase(this.message, oneof);
|
|
2733
|
+
}
|
|
2734
|
+
isSet(field) {
|
|
2735
|
+
assertOwn(this.message, field);
|
|
2736
|
+
return unsafeIsSet(this.message, field);
|
|
2737
|
+
}
|
|
2738
|
+
clear(field) {
|
|
2739
|
+
assertOwn(this.message, field);
|
|
2740
|
+
unsafeClear(this.message, field);
|
|
2741
|
+
}
|
|
2742
|
+
get(field) {
|
|
2743
|
+
assertOwn(this.message, field);
|
|
2744
|
+
const value = unsafeGet(this.message, field);
|
|
2745
|
+
switch (field.fieldKind) {
|
|
2746
|
+
case "list":
|
|
2747
|
+
let list = this.lists.get(field);
|
|
2748
|
+
if (!list || list[unsafeLocal] !== value) {
|
|
2749
|
+
this.lists.set(field, list = new ReflectListImpl(field, value, this.check));
|
|
2750
|
+
}
|
|
2751
|
+
return list;
|
|
2752
|
+
case "map":
|
|
2753
|
+
let map = this.maps.get(field);
|
|
2754
|
+
if (!map || map[unsafeLocal] !== value) {
|
|
2755
|
+
this.maps.set(field, map = new ReflectMapImpl(field, value, this.check));
|
|
2756
|
+
}
|
|
2757
|
+
return map;
|
|
2758
|
+
case "message":
|
|
2759
|
+
return messageToReflect(field, value, this.check);
|
|
2760
|
+
case "scalar":
|
|
2761
|
+
return value === void 0 ? scalarZeroValue(field.scalar, false) : longToReflect(field, value);
|
|
2762
|
+
case "enum":
|
|
2763
|
+
return value !== null && value !== void 0 ? value : field.enum.values[0].number;
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
set(field, value) {
|
|
2767
|
+
assertOwn(this.message, field);
|
|
2768
|
+
if (this.check) {
|
|
2769
|
+
const err = checkField(field, value);
|
|
2770
|
+
if (err) {
|
|
2771
|
+
throw err;
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
let local;
|
|
2775
|
+
if (field.fieldKind == "message") {
|
|
2776
|
+
local = messageToLocal(field, value);
|
|
2777
|
+
} else if (isReflectMap(value) || isReflectList(value)) {
|
|
2778
|
+
local = value[unsafeLocal];
|
|
2779
|
+
} else {
|
|
2780
|
+
local = longToLocal(field, value);
|
|
2781
|
+
}
|
|
2782
|
+
unsafeSet(this.message, field, local);
|
|
2783
|
+
}
|
|
2784
|
+
getUnknown() {
|
|
2785
|
+
return this.message.$unknown;
|
|
2786
|
+
}
|
|
2787
|
+
setUnknown(value) {
|
|
2788
|
+
this.message.$unknown = value;
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
function assertOwn(owner, member) {
|
|
2792
|
+
if (member.parent.typeName !== owner.$typeName) {
|
|
2793
|
+
throw new FieldError(member, `cannot use ${member.toString()} with message ${owner.$typeName}`, "ForeignFieldError");
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
class ReflectListImpl {
|
|
2797
|
+
field() {
|
|
2798
|
+
return this._field;
|
|
2799
|
+
}
|
|
2800
|
+
get size() {
|
|
2801
|
+
return this._arr.length;
|
|
2802
|
+
}
|
|
2803
|
+
constructor(field, unsafeInput, check) {
|
|
2804
|
+
this._field = field;
|
|
2805
|
+
this._arr = this[unsafeLocal] = unsafeInput;
|
|
2806
|
+
this.check = check;
|
|
2807
|
+
}
|
|
2808
|
+
get(index) {
|
|
2809
|
+
const item = this._arr[index];
|
|
2810
|
+
return item === void 0 ? void 0 : listItemToReflect(this._field, item, this.check);
|
|
2811
|
+
}
|
|
2812
|
+
set(index, item) {
|
|
2813
|
+
if (index < 0 || index >= this._arr.length) {
|
|
2814
|
+
throw new FieldError(this._field, `list item #${index + 1}: out of range`);
|
|
2815
|
+
}
|
|
2816
|
+
if (this.check) {
|
|
2817
|
+
const err = checkListItem(this._field, index, item);
|
|
2818
|
+
if (err) {
|
|
2819
|
+
throw err;
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
this._arr[index] = listItemToLocal(this._field, item);
|
|
2823
|
+
}
|
|
2824
|
+
add(item) {
|
|
2825
|
+
if (this.check) {
|
|
2826
|
+
const err = checkListItem(this._field, this._arr.length, item);
|
|
2827
|
+
if (err) {
|
|
2828
|
+
throw err;
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
this._arr.push(listItemToLocal(this._field, item));
|
|
2832
|
+
return void 0;
|
|
2833
|
+
}
|
|
2834
|
+
clear() {
|
|
2835
|
+
this._arr.splice(0, this._arr.length);
|
|
2836
|
+
}
|
|
2837
|
+
[Symbol.iterator]() {
|
|
2838
|
+
return this.values();
|
|
2839
|
+
}
|
|
2840
|
+
keys() {
|
|
2841
|
+
return this._arr.keys();
|
|
2842
|
+
}
|
|
2843
|
+
*values() {
|
|
2844
|
+
for (const item of this._arr) {
|
|
2845
|
+
yield listItemToReflect(this._field, item, this.check);
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
*entries() {
|
|
2849
|
+
for (let i = 0; i < this._arr.length; i++) {
|
|
2850
|
+
yield [i, listItemToReflect(this._field, this._arr[i], this.check)];
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
class ReflectMapImpl {
|
|
2855
|
+
constructor(field, unsafeInput, check = true) {
|
|
2856
|
+
this.obj = this[unsafeLocal] = unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : {};
|
|
2857
|
+
this.check = check;
|
|
2858
|
+
this._field = field;
|
|
2859
|
+
}
|
|
2860
|
+
field() {
|
|
2861
|
+
return this._field;
|
|
2862
|
+
}
|
|
2863
|
+
set(key, value) {
|
|
2864
|
+
if (this.check) {
|
|
2865
|
+
const err = checkMapEntry(this._field, key, value);
|
|
2866
|
+
if (err) {
|
|
2867
|
+
throw err;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
this.obj[mapKeyToLocal(key)] = mapValueToLocal(this._field, value);
|
|
2871
|
+
return this;
|
|
2872
|
+
}
|
|
2873
|
+
delete(key) {
|
|
2874
|
+
const k = mapKeyToLocal(key);
|
|
2875
|
+
const has = Object.prototype.hasOwnProperty.call(this.obj, k);
|
|
2876
|
+
if (has) {
|
|
2877
|
+
delete this.obj[k];
|
|
2878
|
+
}
|
|
2879
|
+
return has;
|
|
2880
|
+
}
|
|
2881
|
+
clear() {
|
|
2882
|
+
for (const key of Object.keys(this.obj)) {
|
|
2883
|
+
delete this.obj[key];
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
get(key) {
|
|
2887
|
+
let val = this.obj[mapKeyToLocal(key)];
|
|
2888
|
+
if (val !== void 0) {
|
|
2889
|
+
val = mapValueToReflect(this._field, val, this.check);
|
|
2890
|
+
}
|
|
2891
|
+
return val;
|
|
2892
|
+
}
|
|
2893
|
+
has(key) {
|
|
2894
|
+
return Object.prototype.hasOwnProperty.call(this.obj, mapKeyToLocal(key));
|
|
2895
|
+
}
|
|
2896
|
+
*keys() {
|
|
2897
|
+
for (const objKey of Object.keys(this.obj)) {
|
|
2898
|
+
yield mapKeyToReflect(objKey, this._field.mapKey);
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
*entries() {
|
|
2902
|
+
for (const objEntry of Object.entries(this.obj)) {
|
|
2903
|
+
yield [
|
|
2904
|
+
mapKeyToReflect(objEntry[0], this._field.mapKey),
|
|
2905
|
+
mapValueToReflect(this._field, objEntry[1], this.check)
|
|
2906
|
+
];
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
[Symbol.iterator]() {
|
|
2910
|
+
return this.entries();
|
|
2911
|
+
}
|
|
2912
|
+
get size() {
|
|
2913
|
+
return Object.keys(this.obj).length;
|
|
2914
|
+
}
|
|
2915
|
+
*values() {
|
|
2916
|
+
for (const val of Object.values(this.obj)) {
|
|
2917
|
+
yield mapValueToReflect(this._field, val, this.check);
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
forEach(callbackfn, thisArg) {
|
|
2921
|
+
for (const mapEntry of this.entries()) {
|
|
2922
|
+
callbackfn.call(thisArg, mapEntry[1], mapEntry[0], this);
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
function messageToLocal(field, value) {
|
|
2927
|
+
if (!isReflectMessage(value)) {
|
|
2928
|
+
return value;
|
|
2929
|
+
}
|
|
2930
|
+
if (isWrapper(value.message) && !field.oneof && field.fieldKind == "message") {
|
|
2931
|
+
return value.message.value;
|
|
2932
|
+
}
|
|
2933
|
+
if (value.desc.typeName == "google.protobuf.Struct" && field.parent.typeName != "google.protobuf.Value") {
|
|
2934
|
+
return wktStructToLocal(value.message);
|
|
2935
|
+
}
|
|
2936
|
+
return value.message;
|
|
2937
|
+
}
|
|
2938
|
+
function messageToReflect(field, value, check) {
|
|
2939
|
+
if (value !== void 0) {
|
|
2940
|
+
if (isWrapperDesc(field.message) && !field.oneof && field.fieldKind == "message") {
|
|
2941
|
+
value = {
|
|
2942
|
+
$typeName: field.message.typeName,
|
|
2943
|
+
value: longToReflect(field.message.fields[0], value)
|
|
2944
|
+
};
|
|
2945
|
+
} else if (field.message.typeName == "google.protobuf.Struct" && field.parent.typeName != "google.protobuf.Value" && isObject(value)) {
|
|
2946
|
+
value = wktStructToReflect(value);
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
return new ReflectMessageImpl(field.message, value, check);
|
|
2950
|
+
}
|
|
2951
|
+
function listItemToLocal(field, value) {
|
|
2952
|
+
if (field.listKind == "message") {
|
|
2953
|
+
return messageToLocal(field, value);
|
|
2954
|
+
}
|
|
2955
|
+
return longToLocal(field, value);
|
|
2956
|
+
}
|
|
2957
|
+
function listItemToReflect(field, value, check) {
|
|
2958
|
+
if (field.listKind == "message") {
|
|
2959
|
+
return messageToReflect(field, value, check);
|
|
2960
|
+
}
|
|
2961
|
+
return longToReflect(field, value);
|
|
2962
|
+
}
|
|
2963
|
+
function mapValueToLocal(field, value) {
|
|
2964
|
+
if (field.mapKind == "message") {
|
|
2965
|
+
return messageToLocal(field, value);
|
|
2966
|
+
}
|
|
2967
|
+
return longToLocal(field, value);
|
|
2968
|
+
}
|
|
2969
|
+
function mapValueToReflect(field, value, check) {
|
|
2970
|
+
if (field.mapKind == "message") {
|
|
2971
|
+
return messageToReflect(field, value, check);
|
|
2972
|
+
}
|
|
2973
|
+
return value;
|
|
2974
|
+
}
|
|
2975
|
+
function mapKeyToLocal(key) {
|
|
2976
|
+
return typeof key == "string" || typeof key == "number" ? key : String(key);
|
|
2977
|
+
}
|
|
2978
|
+
function mapKeyToReflect(key, type) {
|
|
2979
|
+
switch (type) {
|
|
2980
|
+
case ScalarType.STRING:
|
|
2981
|
+
return key;
|
|
2982
|
+
case ScalarType.INT32:
|
|
2983
|
+
case ScalarType.FIXED32:
|
|
2984
|
+
case ScalarType.UINT32:
|
|
2985
|
+
case ScalarType.SFIXED32:
|
|
2986
|
+
case ScalarType.SINT32: {
|
|
2987
|
+
const n = Number.parseInt(key);
|
|
2988
|
+
if (Number.isFinite(n)) {
|
|
2989
|
+
return n;
|
|
2990
|
+
}
|
|
2991
|
+
break;
|
|
2992
|
+
}
|
|
2993
|
+
case ScalarType.BOOL:
|
|
2994
|
+
switch (key) {
|
|
2995
|
+
case "true":
|
|
2996
|
+
return true;
|
|
2997
|
+
case "false":
|
|
2998
|
+
return false;
|
|
2999
|
+
}
|
|
3000
|
+
break;
|
|
3001
|
+
case ScalarType.UINT64:
|
|
3002
|
+
case ScalarType.FIXED64:
|
|
3003
|
+
try {
|
|
3004
|
+
return protoInt64.uParse(key);
|
|
3005
|
+
} catch (_a) {
|
|
3006
|
+
}
|
|
3007
|
+
break;
|
|
3008
|
+
default:
|
|
3009
|
+
try {
|
|
3010
|
+
return protoInt64.parse(key);
|
|
3011
|
+
} catch (_b) {
|
|
3012
|
+
}
|
|
3013
|
+
break;
|
|
3014
|
+
}
|
|
3015
|
+
return key;
|
|
3016
|
+
}
|
|
3017
|
+
function longToReflect(field, value) {
|
|
3018
|
+
switch (field.scalar) {
|
|
3019
|
+
case ScalarType.INT64:
|
|
3020
|
+
case ScalarType.SFIXED64:
|
|
3021
|
+
case ScalarType.SINT64:
|
|
3022
|
+
if ("longAsString" in field && field.longAsString && typeof value == "string") {
|
|
3023
|
+
value = protoInt64.parse(value);
|
|
3024
|
+
}
|
|
3025
|
+
break;
|
|
3026
|
+
case ScalarType.FIXED64:
|
|
3027
|
+
case ScalarType.UINT64:
|
|
3028
|
+
if ("longAsString" in field && field.longAsString && typeof value == "string") {
|
|
3029
|
+
value = protoInt64.uParse(value);
|
|
3030
|
+
}
|
|
3031
|
+
break;
|
|
3032
|
+
}
|
|
3033
|
+
return value;
|
|
3034
|
+
}
|
|
3035
|
+
function longToLocal(field, value) {
|
|
3036
|
+
switch (field.scalar) {
|
|
3037
|
+
case ScalarType.INT64:
|
|
3038
|
+
case ScalarType.SFIXED64:
|
|
3039
|
+
case ScalarType.SINT64:
|
|
3040
|
+
if ("longAsString" in field && field.longAsString) {
|
|
3041
|
+
value = String(value);
|
|
3042
|
+
} else if (typeof value == "string" || typeof value == "number") {
|
|
3043
|
+
value = protoInt64.parse(value);
|
|
3044
|
+
}
|
|
3045
|
+
break;
|
|
3046
|
+
case ScalarType.FIXED64:
|
|
3047
|
+
case ScalarType.UINT64:
|
|
3048
|
+
if ("longAsString" in field && field.longAsString) {
|
|
3049
|
+
value = String(value);
|
|
3050
|
+
} else if (typeof value == "string" || typeof value == "number") {
|
|
3051
|
+
value = protoInt64.uParse(value);
|
|
3052
|
+
}
|
|
3053
|
+
break;
|
|
3054
|
+
}
|
|
3055
|
+
return value;
|
|
3056
|
+
}
|
|
3057
|
+
function wktStructToReflect(json) {
|
|
3058
|
+
const struct = {
|
|
3059
|
+
$typeName: "google.protobuf.Struct",
|
|
3060
|
+
fields: {}
|
|
3061
|
+
};
|
|
3062
|
+
if (isObject(json)) {
|
|
3063
|
+
for (const [k, v] of Object.entries(json)) {
|
|
3064
|
+
struct.fields[k] = wktValueToReflect(v);
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
return struct;
|
|
3068
|
+
}
|
|
3069
|
+
function wktStructToLocal(val) {
|
|
3070
|
+
const json = {};
|
|
3071
|
+
for (const [k, v] of Object.entries(val.fields)) {
|
|
3072
|
+
json[k] = wktValueToLocal(v);
|
|
3073
|
+
}
|
|
3074
|
+
return json;
|
|
3075
|
+
}
|
|
3076
|
+
function wktValueToLocal(val) {
|
|
3077
|
+
switch (val.kind.case) {
|
|
3078
|
+
case "structValue":
|
|
3079
|
+
return wktStructToLocal(val.kind.value);
|
|
3080
|
+
case "listValue":
|
|
3081
|
+
return val.kind.value.values.map(wktValueToLocal);
|
|
3082
|
+
case "nullValue":
|
|
3083
|
+
case void 0:
|
|
3084
|
+
return null;
|
|
3085
|
+
default:
|
|
3086
|
+
return val.kind.value;
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
function wktValueToReflect(json) {
|
|
3090
|
+
const value = {
|
|
3091
|
+
$typeName: "google.protobuf.Value",
|
|
3092
|
+
kind: { case: void 0 }
|
|
3093
|
+
};
|
|
3094
|
+
switch (typeof json) {
|
|
3095
|
+
case "number":
|
|
3096
|
+
value.kind = { case: "numberValue", value: json };
|
|
3097
|
+
break;
|
|
3098
|
+
case "string":
|
|
3099
|
+
value.kind = { case: "stringValue", value: json };
|
|
3100
|
+
break;
|
|
3101
|
+
case "boolean":
|
|
3102
|
+
value.kind = { case: "boolValue", value: json };
|
|
3103
|
+
break;
|
|
3104
|
+
case "object":
|
|
3105
|
+
if (json === null) {
|
|
3106
|
+
const nullValue = 0;
|
|
3107
|
+
value.kind = { case: "nullValue", value: nullValue };
|
|
3108
|
+
} else if (Array.isArray(json)) {
|
|
3109
|
+
const listValue = {
|
|
3110
|
+
$typeName: "google.protobuf.ListValue",
|
|
3111
|
+
values: []
|
|
3112
|
+
};
|
|
3113
|
+
if (Array.isArray(json)) {
|
|
3114
|
+
for (const e of json) {
|
|
3115
|
+
listValue.values.push(wktValueToReflect(e));
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
value.kind = {
|
|
3119
|
+
case: "listValue",
|
|
3120
|
+
value: listValue
|
|
3121
|
+
};
|
|
3122
|
+
} else {
|
|
3123
|
+
value.kind = {
|
|
3124
|
+
case: "structValue",
|
|
3125
|
+
value: wktStructToReflect(json)
|
|
3126
|
+
};
|
|
3127
|
+
}
|
|
3128
|
+
break;
|
|
3129
|
+
}
|
|
3130
|
+
return value;
|
|
3131
|
+
}
|
|
3132
|
+
function messageDesc(file, path, ...paths) {
|
|
3133
|
+
return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]);
|
|
3134
|
+
}
|
|
3135
|
+
const file_google_protobuf_descriptor = /* @__PURE__ */ boot({ "name": "google/protobuf/descriptor.proto", "package": "google.protobuf", "messageType": [{ "name": "FileDescriptorSet", "field": [{ "name": "file", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.FileDescriptorProto" }], "extensionRange": [{ "start": 536e6, "end": 536000001 }] }, { "name": "FileDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "package", "number": 2, "type": 9, "label": 1 }, { "name": "dependency", "number": 3, "type": 9, "label": 3 }, { "name": "public_dependency", "number": 10, "type": 5, "label": 3 }, { "name": "weak_dependency", "number": 11, "type": 5, "label": 3 }, { "name": "message_type", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto" }, { "name": "enum_type", "number": 5, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto" }, { "name": "service", "number": 6, "type": 11, "label": 3, "typeName": ".google.protobuf.ServiceDescriptorProto" }, { "name": "extension", "number": 7, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "options", "number": 8, "type": 11, "label": 1, "typeName": ".google.protobuf.FileOptions" }, { "name": "source_code_info", "number": 9, "type": 11, "label": 1, "typeName": ".google.protobuf.SourceCodeInfo" }, { "name": "syntax", "number": 12, "type": 9, "label": 1 }, { "name": "edition", "number": 14, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }] }, { "name": "DescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "field", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "extension", "number": 6, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "nested_type", "number": 3, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto" }, { "name": "enum_type", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto" }, { "name": "extension_range", "number": 5, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto.ExtensionRange" }, { "name": "oneof_decl", "number": 8, "type": 11, "label": 3, "typeName": ".google.protobuf.OneofDescriptorProto" }, { "name": "options", "number": 7, "type": 11, "label": 1, "typeName": ".google.protobuf.MessageOptions" }, { "name": "reserved_range", "number": 9, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto.ReservedRange" }, { "name": "reserved_name", "number": 10, "type": 9, "label": 3 }], "nestedType": [{ "name": "ExtensionRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.ExtensionRangeOptions" }] }, { "name": "ReservedRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }] }] }, { "name": "ExtensionRangeOptions", "field": [{ "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }, { "name": "declaration", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.ExtensionRangeOptions.Declaration", "options": { "retention": 2 } }, { "name": "features", "number": 50, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "verification", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.ExtensionRangeOptions.VerificationState", "defaultValue": "UNVERIFIED", "options": { "retention": 2 } }], "nestedType": [{ "name": "Declaration", "field": [{ "name": "number", "number": 1, "type": 5, "label": 1 }, { "name": "full_name", "number": 2, "type": 9, "label": 1 }, { "name": "type", "number": 3, "type": 9, "label": 1 }, { "name": "reserved", "number": 5, "type": 8, "label": 1 }, { "name": "repeated", "number": 6, "type": 8, "label": 1 }] }], "enumType": [{ "name": "VerificationState", "value": [{ "name": "DECLARATION", "number": 0 }, { "name": "UNVERIFIED", "number": 1 }] }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "FieldDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "number", "number": 3, "type": 5, "label": 1 }, { "name": "label", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldDescriptorProto.Label" }, { "name": "type", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldDescriptorProto.Type" }, { "name": "type_name", "number": 6, "type": 9, "label": 1 }, { "name": "extendee", "number": 2, "type": 9, "label": 1 }, { "name": "default_value", "number": 7, "type": 9, "label": 1 }, { "name": "oneof_index", "number": 9, "type": 5, "label": 1 }, { "name": "json_name", "number": 10, "type": 9, "label": 1 }, { "name": "options", "number": 8, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions" }, { "name": "proto3_optional", "number": 17, "type": 8, "label": 1 }], "enumType": [{ "name": "Type", "value": [{ "name": "TYPE_DOUBLE", "number": 1 }, { "name": "TYPE_FLOAT", "number": 2 }, { "name": "TYPE_INT64", "number": 3 }, { "name": "TYPE_UINT64", "number": 4 }, { "name": "TYPE_INT32", "number": 5 }, { "name": "TYPE_FIXED64", "number": 6 }, { "name": "TYPE_FIXED32", "number": 7 }, { "name": "TYPE_BOOL", "number": 8 }, { "name": "TYPE_STRING", "number": 9 }, { "name": "TYPE_GROUP", "number": 10 }, { "name": "TYPE_MESSAGE", "number": 11 }, { "name": "TYPE_BYTES", "number": 12 }, { "name": "TYPE_UINT32", "number": 13 }, { "name": "TYPE_ENUM", "number": 14 }, { "name": "TYPE_SFIXED32", "number": 15 }, { "name": "TYPE_SFIXED64", "number": 16 }, { "name": "TYPE_SINT32", "number": 17 }, { "name": "TYPE_SINT64", "number": 18 }] }, { "name": "Label", "value": [{ "name": "LABEL_OPTIONAL", "number": 1 }, { "name": "LABEL_REPEATED", "number": 3 }, { "name": "LABEL_REQUIRED", "number": 2 }] }] }, { "name": "OneofDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "options", "number": 2, "type": 11, "label": 1, "typeName": ".google.protobuf.OneofOptions" }] }, { "name": "EnumDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "value", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumValueDescriptorProto" }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.EnumOptions" }, { "name": "reserved_range", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto.EnumReservedRange" }, { "name": "reserved_name", "number": 5, "type": 9, "label": 3 }], "nestedType": [{ "name": "EnumReservedRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }] }] }, { "name": "EnumValueDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "number", "number": 2, "type": 5, "label": 1 }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.EnumValueOptions" }] }, { "name": "ServiceDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "method", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.MethodDescriptorProto" }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.ServiceOptions" }] }, { "name": "MethodDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "input_type", "number": 2, "type": 9, "label": 1 }, { "name": "output_type", "number": 3, "type": 9, "label": 1 }, { "name": "options", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.MethodOptions" }, { "name": "client_streaming", "number": 5, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "server_streaming", "number": 6, "type": 8, "label": 1, "defaultValue": "false" }] }, { "name": "FileOptions", "field": [{ "name": "java_package", "number": 1, "type": 9, "label": 1 }, { "name": "java_outer_classname", "number": 8, "type": 9, "label": 1 }, { "name": "java_multiple_files", "number": 10, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "java_generate_equals_and_hash", "number": 20, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "java_string_check_utf8", "number": 27, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "optimize_for", "number": 9, "type": 14, "label": 1, "typeName": ".google.protobuf.FileOptions.OptimizeMode", "defaultValue": "SPEED" }, { "name": "go_package", "number": 11, "type": 9, "label": 1 }, { "name": "cc_generic_services", "number": 16, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "java_generic_services", "number": 17, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "py_generic_services", "number": 18, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 23, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "cc_enable_arenas", "number": 31, "type": 8, "label": 1, "defaultValue": "true" }, { "name": "objc_class_prefix", "number": 36, "type": 9, "label": 1 }, { "name": "csharp_namespace", "number": 37, "type": 9, "label": 1 }, { "name": "swift_prefix", "number": 39, "type": 9, "label": 1 }, { "name": "php_class_prefix", "number": 40, "type": 9, "label": 1 }, { "name": "php_namespace", "number": 41, "type": 9, "label": 1 }, { "name": "php_metadata_namespace", "number": 44, "type": 9, "label": 1 }, { "name": "ruby_package", "number": 45, "type": 9, "label": 1 }, { "name": "features", "number": 50, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "enumType": [{ "name": "OptimizeMode", "value": [{ "name": "SPEED", "number": 1 }, { "name": "CODE_SIZE", "number": 2 }, { "name": "LITE_RUNTIME", "number": 3 }] }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "MessageOptions", "field": [{ "name": "message_set_wire_format", "number": 1, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "no_standard_descriptor_accessor", "number": 2, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "map_entry", "number": 7, "type": 8, "label": 1 }, { "name": "deprecated_legacy_json_field_conflicts", "number": 11, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "features", "number": 12, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "FieldOptions", "field": [{ "name": "ctype", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.CType", "defaultValue": "STRING" }, { "name": "packed", "number": 2, "type": 8, "label": 1 }, { "name": "jstype", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.JSType", "defaultValue": "JS_NORMAL" }, { "name": "lazy", "number": 5, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "unverified_lazy", "number": 15, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "weak", "number": 10, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "debug_redact", "number": 16, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "retention", "number": 17, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.OptionRetention" }, { "name": "targets", "number": 19, "type": 14, "label": 3, "typeName": ".google.protobuf.FieldOptions.OptionTargetType" }, { "name": "edition_defaults", "number": 20, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldOptions.EditionDefault" }, { "name": "features", "number": 21, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "feature_support", "number": 22, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions.FeatureSupport" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "nestedType": [{ "name": "EditionDefault", "field": [{ "name": "edition", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "value", "number": 2, "type": 9, "label": 1 }] }, { "name": "FeatureSupport", "field": [{ "name": "edition_introduced", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "edition_deprecated", "number": 2, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "deprecation_warning", "number": 3, "type": 9, "label": 1 }, { "name": "edition_removed", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }] }], "enumType": [{ "name": "CType", "value": [{ "name": "STRING", "number": 0 }, { "name": "CORD", "number": 1 }, { "name": "STRING_PIECE", "number": 2 }] }, { "name": "JSType", "value": [{ "name": "JS_NORMAL", "number": 0 }, { "name": "JS_STRING", "number": 1 }, { "name": "JS_NUMBER", "number": 2 }] }, { "name": "OptionRetention", "value": [{ "name": "RETENTION_UNKNOWN", "number": 0 }, { "name": "RETENTION_RUNTIME", "number": 1 }, { "name": "RETENTION_SOURCE", "number": 2 }] }, { "name": "OptionTargetType", "value": [{ "name": "TARGET_TYPE_UNKNOWN", "number": 0 }, { "name": "TARGET_TYPE_FILE", "number": 1 }, { "name": "TARGET_TYPE_EXTENSION_RANGE", "number": 2 }, { "name": "TARGET_TYPE_MESSAGE", "number": 3 }, { "name": "TARGET_TYPE_FIELD", "number": 4 }, { "name": "TARGET_TYPE_ONEOF", "number": 5 }, { "name": "TARGET_TYPE_ENUM", "number": 6 }, { "name": "TARGET_TYPE_ENUM_ENTRY", "number": 7 }, { "name": "TARGET_TYPE_SERVICE", "number": 8 }, { "name": "TARGET_TYPE_METHOD", "number": 9 }] }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "OneofOptions", "field": [{ "name": "features", "number": 1, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "EnumOptions", "field": [{ "name": "allow_alias", "number": 2, "type": 8, "label": 1 }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated_legacy_json_field_conflicts", "number": 6, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "features", "number": 7, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "EnumValueOptions", "field": [{ "name": "deprecated", "number": 1, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "features", "number": 2, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "debug_redact", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "feature_support", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions.FeatureSupport" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "ServiceOptions", "field": [{ "name": "features", "number": 34, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "deprecated", "number": 33, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "MethodOptions", "field": [{ "name": "deprecated", "number": 33, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "idempotency_level", "number": 34, "type": 14, "label": 1, "typeName": ".google.protobuf.MethodOptions.IdempotencyLevel", "defaultValue": "IDEMPOTENCY_UNKNOWN" }, { "name": "features", "number": 35, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "enumType": [{ "name": "IdempotencyLevel", "value": [{ "name": "IDEMPOTENCY_UNKNOWN", "number": 0 }, { "name": "NO_SIDE_EFFECTS", "number": 1 }, { "name": "IDEMPOTENT", "number": 2 }] }], "extensionRange": [{ "start": 1e3, "end": 536870912 }] }, { "name": "UninterpretedOption", "field": [{ "name": "name", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption.NamePart" }, { "name": "identifier_value", "number": 3, "type": 9, "label": 1 }, { "name": "positive_int_value", "number": 4, "type": 4, "label": 1 }, { "name": "negative_int_value", "number": 5, "type": 3, "label": 1 }, { "name": "double_value", "number": 6, "type": 1, "label": 1 }, { "name": "string_value", "number": 7, "type": 12, "label": 1 }, { "name": "aggregate_value", "number": 8, "type": 9, "label": 1 }], "nestedType": [{ "name": "NamePart", "field": [{ "name": "name_part", "number": 1, "type": 9, "label": 2 }, { "name": "is_extension", "number": 2, "type": 8, "label": 2 }] }] }, { "name": "FeatureSet", "field": [{ "name": "field_presence", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.FieldPresence", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "EXPLICIT", "edition": 900 }, { "value": "IMPLICIT", "edition": 999 }, { "value": "EXPLICIT", "edition": 1e3 }] } }, { "name": "enum_type", "number": 2, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.EnumType", "options": { "retention": 1, "targets": [6, 1], "editionDefaults": [{ "value": "CLOSED", "edition": 900 }, { "value": "OPEN", "edition": 999 }] } }, { "name": "repeated_field_encoding", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.RepeatedFieldEncoding", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "EXPANDED", "edition": 900 }, { "value": "PACKED", "edition": 999 }] } }, { "name": "utf8_validation", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.Utf8Validation", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "NONE", "edition": 900 }, { "value": "VERIFY", "edition": 999 }] } }, { "name": "message_encoding", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.MessageEncoding", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "LENGTH_PREFIXED", "edition": 900 }] } }, { "name": "json_format", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.JsonFormat", "options": { "retention": 1, "targets": [3, 6, 1], "editionDefaults": [{ "value": "LEGACY_BEST_EFFORT", "edition": 900 }, { "value": "ALLOW", "edition": 999 }] } }, { "name": "enforce_naming_style", "number": 7, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.EnforceNamingStyle", "options": { "retention": 2, "targets": [1, 2, 3, 4, 5, 6, 7, 8, 9], "editionDefaults": [{ "value": "STYLE_LEGACY", "edition": 900 }, { "value": "STYLE2024", "edition": 1001 }] } }], "enumType": [{ "name": "FieldPresence", "value": [{ "name": "FIELD_PRESENCE_UNKNOWN", "number": 0 }, { "name": "EXPLICIT", "number": 1 }, { "name": "IMPLICIT", "number": 2 }, { "name": "LEGACY_REQUIRED", "number": 3 }] }, { "name": "EnumType", "value": [{ "name": "ENUM_TYPE_UNKNOWN", "number": 0 }, { "name": "OPEN", "number": 1 }, { "name": "CLOSED", "number": 2 }] }, { "name": "RepeatedFieldEncoding", "value": [{ "name": "REPEATED_FIELD_ENCODING_UNKNOWN", "number": 0 }, { "name": "PACKED", "number": 1 }, { "name": "EXPANDED", "number": 2 }] }, { "name": "Utf8Validation", "value": [{ "name": "UTF8_VALIDATION_UNKNOWN", "number": 0 }, { "name": "VERIFY", "number": 2 }, { "name": "NONE", "number": 3 }] }, { "name": "MessageEncoding", "value": [{ "name": "MESSAGE_ENCODING_UNKNOWN", "number": 0 }, { "name": "LENGTH_PREFIXED", "number": 1 }, { "name": "DELIMITED", "number": 2 }] }, { "name": "JsonFormat", "value": [{ "name": "JSON_FORMAT_UNKNOWN", "number": 0 }, { "name": "ALLOW", "number": 1 }, { "name": "LEGACY_BEST_EFFORT", "number": 2 }] }, { "name": "EnforceNamingStyle", "value": [{ "name": "ENFORCE_NAMING_STYLE_UNKNOWN", "number": 0 }, { "name": "STYLE2024", "number": 1 }, { "name": "STYLE_LEGACY", "number": 2 }] }], "extensionRange": [{ "start": 1e3, "end": 9995 }, { "start": 9995, "end": 1e4 }, { "start": 1e4, "end": 10001 }] }, { "name": "FeatureSetDefaults", "field": [{ "name": "defaults", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" }, { "name": "minimum_edition", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "maximum_edition", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }], "nestedType": [{ "name": "FeatureSetEditionDefault", "field": [{ "name": "edition", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "overridable_features", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "fixed_features", "number": 5, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }] }] }, { "name": "SourceCodeInfo", "field": [{ "name": "location", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.SourceCodeInfo.Location" }], "nestedType": [{ "name": "Location", "field": [{ "name": "path", "number": 1, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "span", "number": 2, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "leading_comments", "number": 3, "type": 9, "label": 1 }, { "name": "trailing_comments", "number": 4, "type": 9, "label": 1 }, { "name": "leading_detached_comments", "number": 6, "type": 9, "label": 3 }] }], "extensionRange": [{ "start": 536e6, "end": 536000001 }] }, { "name": "GeneratedCodeInfo", "field": [{ "name": "annotation", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.GeneratedCodeInfo.Annotation" }], "nestedType": [{ "name": "Annotation", "field": [{ "name": "path", "number": 1, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "source_file", "number": 2, "type": 9, "label": 1 }, { "name": "begin", "number": 3, "type": 5, "label": 1 }, { "name": "end", "number": 4, "type": 5, "label": 1 }, { "name": "semantic", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic" }], "enumType": [{ "name": "Semantic", "value": [{ "name": "NONE", "number": 0 }, { "name": "SET", "number": 1 }, { "name": "ALIAS", "number": 2 }] }] }] }], "enumType": [{ "name": "Edition", "value": [{ "name": "EDITION_UNKNOWN", "number": 0 }, { "name": "EDITION_LEGACY", "number": 900 }, { "name": "EDITION_PROTO2", "number": 998 }, { "name": "EDITION_PROTO3", "number": 999 }, { "name": "EDITION_2023", "number": 1e3 }, { "name": "EDITION_2024", "number": 1001 }, { "name": "EDITION_1_TEST_ONLY", "number": 1 }, { "name": "EDITION_2_TEST_ONLY", "number": 2 }, { "name": "EDITION_99997_TEST_ONLY", "number": 99997 }, { "name": "EDITION_99998_TEST_ONLY", "number": 99998 }, { "name": "EDITION_99999_TEST_ONLY", "number": 99999 }, { "name": "EDITION_MAX", "number": 2147483647 }] }] });
|
|
3136
|
+
const FileDescriptorProtoSchema = /* @__PURE__ */ messageDesc(file_google_protobuf_descriptor, 1);
|
|
3137
|
+
var ExtensionRangeOptions_VerificationState;
|
|
3138
|
+
(function(ExtensionRangeOptions_VerificationState2) {
|
|
3139
|
+
ExtensionRangeOptions_VerificationState2[ExtensionRangeOptions_VerificationState2["DECLARATION"] = 0] = "DECLARATION";
|
|
3140
|
+
ExtensionRangeOptions_VerificationState2[ExtensionRangeOptions_VerificationState2["UNVERIFIED"] = 1] = "UNVERIFIED";
|
|
3141
|
+
})(ExtensionRangeOptions_VerificationState || (ExtensionRangeOptions_VerificationState = {}));
|
|
3142
|
+
var FieldDescriptorProto_Type;
|
|
3143
|
+
(function(FieldDescriptorProto_Type2) {
|
|
3144
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["DOUBLE"] = 1] = "DOUBLE";
|
|
3145
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["FLOAT"] = 2] = "FLOAT";
|
|
3146
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["INT64"] = 3] = "INT64";
|
|
3147
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["UINT64"] = 4] = "UINT64";
|
|
3148
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["INT32"] = 5] = "INT32";
|
|
3149
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["FIXED64"] = 6] = "FIXED64";
|
|
3150
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["FIXED32"] = 7] = "FIXED32";
|
|
3151
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["BOOL"] = 8] = "BOOL";
|
|
3152
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["STRING"] = 9] = "STRING";
|
|
3153
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["GROUP"] = 10] = "GROUP";
|
|
3154
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["MESSAGE"] = 11] = "MESSAGE";
|
|
3155
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["BYTES"] = 12] = "BYTES";
|
|
3156
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["UINT32"] = 13] = "UINT32";
|
|
3157
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["ENUM"] = 14] = "ENUM";
|
|
3158
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["SFIXED32"] = 15] = "SFIXED32";
|
|
3159
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["SFIXED64"] = 16] = "SFIXED64";
|
|
3160
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["SINT32"] = 17] = "SINT32";
|
|
3161
|
+
FieldDescriptorProto_Type2[FieldDescriptorProto_Type2["SINT64"] = 18] = "SINT64";
|
|
3162
|
+
})(FieldDescriptorProto_Type || (FieldDescriptorProto_Type = {}));
|
|
3163
|
+
var FieldDescriptorProto_Label;
|
|
3164
|
+
(function(FieldDescriptorProto_Label2) {
|
|
3165
|
+
FieldDescriptorProto_Label2[FieldDescriptorProto_Label2["OPTIONAL"] = 1] = "OPTIONAL";
|
|
3166
|
+
FieldDescriptorProto_Label2[FieldDescriptorProto_Label2["REPEATED"] = 3] = "REPEATED";
|
|
3167
|
+
FieldDescriptorProto_Label2[FieldDescriptorProto_Label2["REQUIRED"] = 2] = "REQUIRED";
|
|
3168
|
+
})(FieldDescriptorProto_Label || (FieldDescriptorProto_Label = {}));
|
|
3169
|
+
var FileOptions_OptimizeMode;
|
|
3170
|
+
(function(FileOptions_OptimizeMode2) {
|
|
3171
|
+
FileOptions_OptimizeMode2[FileOptions_OptimizeMode2["SPEED"] = 1] = "SPEED";
|
|
3172
|
+
FileOptions_OptimizeMode2[FileOptions_OptimizeMode2["CODE_SIZE"] = 2] = "CODE_SIZE";
|
|
3173
|
+
FileOptions_OptimizeMode2[FileOptions_OptimizeMode2["LITE_RUNTIME"] = 3] = "LITE_RUNTIME";
|
|
3174
|
+
})(FileOptions_OptimizeMode || (FileOptions_OptimizeMode = {}));
|
|
3175
|
+
var FieldOptions_CType;
|
|
3176
|
+
(function(FieldOptions_CType2) {
|
|
3177
|
+
FieldOptions_CType2[FieldOptions_CType2["STRING"] = 0] = "STRING";
|
|
3178
|
+
FieldOptions_CType2[FieldOptions_CType2["CORD"] = 1] = "CORD";
|
|
3179
|
+
FieldOptions_CType2[FieldOptions_CType2["STRING_PIECE"] = 2] = "STRING_PIECE";
|
|
3180
|
+
})(FieldOptions_CType || (FieldOptions_CType = {}));
|
|
3181
|
+
var FieldOptions_JSType;
|
|
3182
|
+
(function(FieldOptions_JSType2) {
|
|
3183
|
+
FieldOptions_JSType2[FieldOptions_JSType2["JS_NORMAL"] = 0] = "JS_NORMAL";
|
|
3184
|
+
FieldOptions_JSType2[FieldOptions_JSType2["JS_STRING"] = 1] = "JS_STRING";
|
|
3185
|
+
FieldOptions_JSType2[FieldOptions_JSType2["JS_NUMBER"] = 2] = "JS_NUMBER";
|
|
3186
|
+
})(FieldOptions_JSType || (FieldOptions_JSType = {}));
|
|
3187
|
+
var FieldOptions_OptionRetention;
|
|
3188
|
+
(function(FieldOptions_OptionRetention2) {
|
|
3189
|
+
FieldOptions_OptionRetention2[FieldOptions_OptionRetention2["RETENTION_UNKNOWN"] = 0] = "RETENTION_UNKNOWN";
|
|
3190
|
+
FieldOptions_OptionRetention2[FieldOptions_OptionRetention2["RETENTION_RUNTIME"] = 1] = "RETENTION_RUNTIME";
|
|
3191
|
+
FieldOptions_OptionRetention2[FieldOptions_OptionRetention2["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE";
|
|
3192
|
+
})(FieldOptions_OptionRetention || (FieldOptions_OptionRetention = {}));
|
|
3193
|
+
var FieldOptions_OptionTargetType;
|
|
3194
|
+
(function(FieldOptions_OptionTargetType2) {
|
|
3195
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_UNKNOWN"] = 0] = "TARGET_TYPE_UNKNOWN";
|
|
3196
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_FILE"] = 1] = "TARGET_TYPE_FILE";
|
|
3197
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_EXTENSION_RANGE"] = 2] = "TARGET_TYPE_EXTENSION_RANGE";
|
|
3198
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_MESSAGE"] = 3] = "TARGET_TYPE_MESSAGE";
|
|
3199
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_FIELD"] = 4] = "TARGET_TYPE_FIELD";
|
|
3200
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_ONEOF"] = 5] = "TARGET_TYPE_ONEOF";
|
|
3201
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_ENUM"] = 6] = "TARGET_TYPE_ENUM";
|
|
3202
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_ENUM_ENTRY"] = 7] = "TARGET_TYPE_ENUM_ENTRY";
|
|
3203
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_SERVICE"] = 8] = "TARGET_TYPE_SERVICE";
|
|
3204
|
+
FieldOptions_OptionTargetType2[FieldOptions_OptionTargetType2["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD";
|
|
3205
|
+
})(FieldOptions_OptionTargetType || (FieldOptions_OptionTargetType = {}));
|
|
3206
|
+
var MethodOptions_IdempotencyLevel;
|
|
3207
|
+
(function(MethodOptions_IdempotencyLevel2) {
|
|
3208
|
+
MethodOptions_IdempotencyLevel2[MethodOptions_IdempotencyLevel2["IDEMPOTENCY_UNKNOWN"] = 0] = "IDEMPOTENCY_UNKNOWN";
|
|
3209
|
+
MethodOptions_IdempotencyLevel2[MethodOptions_IdempotencyLevel2["NO_SIDE_EFFECTS"] = 1] = "NO_SIDE_EFFECTS";
|
|
3210
|
+
MethodOptions_IdempotencyLevel2[MethodOptions_IdempotencyLevel2["IDEMPOTENT"] = 2] = "IDEMPOTENT";
|
|
3211
|
+
})(MethodOptions_IdempotencyLevel || (MethodOptions_IdempotencyLevel = {}));
|
|
3212
|
+
var FeatureSet_FieldPresence;
|
|
3213
|
+
(function(FeatureSet_FieldPresence2) {
|
|
3214
|
+
FeatureSet_FieldPresence2[FeatureSet_FieldPresence2["FIELD_PRESENCE_UNKNOWN"] = 0] = "FIELD_PRESENCE_UNKNOWN";
|
|
3215
|
+
FeatureSet_FieldPresence2[FeatureSet_FieldPresence2["EXPLICIT"] = 1] = "EXPLICIT";
|
|
3216
|
+
FeatureSet_FieldPresence2[FeatureSet_FieldPresence2["IMPLICIT"] = 2] = "IMPLICIT";
|
|
3217
|
+
FeatureSet_FieldPresence2[FeatureSet_FieldPresence2["LEGACY_REQUIRED"] = 3] = "LEGACY_REQUIRED";
|
|
3218
|
+
})(FeatureSet_FieldPresence || (FeatureSet_FieldPresence = {}));
|
|
3219
|
+
var FeatureSet_EnumType;
|
|
3220
|
+
(function(FeatureSet_EnumType2) {
|
|
3221
|
+
FeatureSet_EnumType2[FeatureSet_EnumType2["ENUM_TYPE_UNKNOWN"] = 0] = "ENUM_TYPE_UNKNOWN";
|
|
3222
|
+
FeatureSet_EnumType2[FeatureSet_EnumType2["OPEN"] = 1] = "OPEN";
|
|
3223
|
+
FeatureSet_EnumType2[FeatureSet_EnumType2["CLOSED"] = 2] = "CLOSED";
|
|
3224
|
+
})(FeatureSet_EnumType || (FeatureSet_EnumType = {}));
|
|
3225
|
+
var FeatureSet_RepeatedFieldEncoding;
|
|
3226
|
+
(function(FeatureSet_RepeatedFieldEncoding2) {
|
|
3227
|
+
FeatureSet_RepeatedFieldEncoding2[FeatureSet_RepeatedFieldEncoding2["REPEATED_FIELD_ENCODING_UNKNOWN"] = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN";
|
|
3228
|
+
FeatureSet_RepeatedFieldEncoding2[FeatureSet_RepeatedFieldEncoding2["PACKED"] = 1] = "PACKED";
|
|
3229
|
+
FeatureSet_RepeatedFieldEncoding2[FeatureSet_RepeatedFieldEncoding2["EXPANDED"] = 2] = "EXPANDED";
|
|
3230
|
+
})(FeatureSet_RepeatedFieldEncoding || (FeatureSet_RepeatedFieldEncoding = {}));
|
|
3231
|
+
var FeatureSet_Utf8Validation;
|
|
3232
|
+
(function(FeatureSet_Utf8Validation2) {
|
|
3233
|
+
FeatureSet_Utf8Validation2[FeatureSet_Utf8Validation2["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN";
|
|
3234
|
+
FeatureSet_Utf8Validation2[FeatureSet_Utf8Validation2["VERIFY"] = 2] = "VERIFY";
|
|
3235
|
+
FeatureSet_Utf8Validation2[FeatureSet_Utf8Validation2["NONE"] = 3] = "NONE";
|
|
3236
|
+
})(FeatureSet_Utf8Validation || (FeatureSet_Utf8Validation = {}));
|
|
3237
|
+
var FeatureSet_MessageEncoding;
|
|
3238
|
+
(function(FeatureSet_MessageEncoding2) {
|
|
3239
|
+
FeatureSet_MessageEncoding2[FeatureSet_MessageEncoding2["MESSAGE_ENCODING_UNKNOWN"] = 0] = "MESSAGE_ENCODING_UNKNOWN";
|
|
3240
|
+
FeatureSet_MessageEncoding2[FeatureSet_MessageEncoding2["LENGTH_PREFIXED"] = 1] = "LENGTH_PREFIXED";
|
|
3241
|
+
FeatureSet_MessageEncoding2[FeatureSet_MessageEncoding2["DELIMITED"] = 2] = "DELIMITED";
|
|
3242
|
+
})(FeatureSet_MessageEncoding || (FeatureSet_MessageEncoding = {}));
|
|
3243
|
+
var FeatureSet_JsonFormat;
|
|
3244
|
+
(function(FeatureSet_JsonFormat2) {
|
|
3245
|
+
FeatureSet_JsonFormat2[FeatureSet_JsonFormat2["JSON_FORMAT_UNKNOWN"] = 0] = "JSON_FORMAT_UNKNOWN";
|
|
3246
|
+
FeatureSet_JsonFormat2[FeatureSet_JsonFormat2["ALLOW"] = 1] = "ALLOW";
|
|
3247
|
+
FeatureSet_JsonFormat2[FeatureSet_JsonFormat2["LEGACY_BEST_EFFORT"] = 2] = "LEGACY_BEST_EFFORT";
|
|
3248
|
+
})(FeatureSet_JsonFormat || (FeatureSet_JsonFormat = {}));
|
|
3249
|
+
var FeatureSet_EnforceNamingStyle;
|
|
3250
|
+
(function(FeatureSet_EnforceNamingStyle2) {
|
|
3251
|
+
FeatureSet_EnforceNamingStyle2[FeatureSet_EnforceNamingStyle2["ENFORCE_NAMING_STYLE_UNKNOWN"] = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN";
|
|
3252
|
+
FeatureSet_EnforceNamingStyle2[FeatureSet_EnforceNamingStyle2["STYLE2024"] = 1] = "STYLE2024";
|
|
3253
|
+
FeatureSet_EnforceNamingStyle2[FeatureSet_EnforceNamingStyle2["STYLE_LEGACY"] = 2] = "STYLE_LEGACY";
|
|
3254
|
+
})(FeatureSet_EnforceNamingStyle || (FeatureSet_EnforceNamingStyle = {}));
|
|
3255
|
+
var GeneratedCodeInfo_Annotation_Semantic;
|
|
3256
|
+
(function(GeneratedCodeInfo_Annotation_Semantic2) {
|
|
3257
|
+
GeneratedCodeInfo_Annotation_Semantic2[GeneratedCodeInfo_Annotation_Semantic2["NONE"] = 0] = "NONE";
|
|
3258
|
+
GeneratedCodeInfo_Annotation_Semantic2[GeneratedCodeInfo_Annotation_Semantic2["SET"] = 1] = "SET";
|
|
3259
|
+
GeneratedCodeInfo_Annotation_Semantic2[GeneratedCodeInfo_Annotation_Semantic2["ALIAS"] = 2] = "ALIAS";
|
|
3260
|
+
})(GeneratedCodeInfo_Annotation_Semantic || (GeneratedCodeInfo_Annotation_Semantic = {}));
|
|
3261
|
+
var Edition;
|
|
3262
|
+
(function(Edition2) {
|
|
3263
|
+
Edition2[Edition2["EDITION_UNKNOWN"] = 0] = "EDITION_UNKNOWN";
|
|
3264
|
+
Edition2[Edition2["EDITION_LEGACY"] = 900] = "EDITION_LEGACY";
|
|
3265
|
+
Edition2[Edition2["EDITION_PROTO2"] = 998] = "EDITION_PROTO2";
|
|
3266
|
+
Edition2[Edition2["EDITION_PROTO3"] = 999] = "EDITION_PROTO3";
|
|
3267
|
+
Edition2[Edition2["EDITION_2023"] = 1e3] = "EDITION_2023";
|
|
3268
|
+
Edition2[Edition2["EDITION_2024"] = 1001] = "EDITION_2024";
|
|
3269
|
+
Edition2[Edition2["EDITION_1_TEST_ONLY"] = 1] = "EDITION_1_TEST_ONLY";
|
|
3270
|
+
Edition2[Edition2["EDITION_2_TEST_ONLY"] = 2] = "EDITION_2_TEST_ONLY";
|
|
3271
|
+
Edition2[Edition2["EDITION_99997_TEST_ONLY"] = 99997] = "EDITION_99997_TEST_ONLY";
|
|
3272
|
+
Edition2[Edition2["EDITION_99998_TEST_ONLY"] = 99998] = "EDITION_99998_TEST_ONLY";
|
|
3273
|
+
Edition2[Edition2["EDITION_99999_TEST_ONLY"] = 99999] = "EDITION_99999_TEST_ONLY";
|
|
3274
|
+
Edition2[Edition2["EDITION_MAX"] = 2147483647] = "EDITION_MAX";
|
|
3275
|
+
})(Edition || (Edition = {}));
|
|
3276
|
+
const readDefaults = {
|
|
3277
|
+
readUnknownFields: true
|
|
3278
|
+
};
|
|
3279
|
+
function makeReadOptions(options) {
|
|
3280
|
+
return options ? Object.assign(Object.assign({}, readDefaults), options) : readDefaults;
|
|
3281
|
+
}
|
|
3282
|
+
function fromBinary(schema, bytes, options) {
|
|
3283
|
+
const msg = reflect(schema, void 0, false);
|
|
3284
|
+
readMessage(msg, new BinaryReader(bytes), makeReadOptions(options), false, bytes.byteLength);
|
|
3285
|
+
return msg.message;
|
|
3286
|
+
}
|
|
3287
|
+
function readMessage(message, reader, options, delimited, lengthOrDelimitedFieldNo) {
|
|
3288
|
+
var _a;
|
|
3289
|
+
const end = delimited ? reader.len : reader.pos + lengthOrDelimitedFieldNo;
|
|
3290
|
+
let fieldNo, wireType;
|
|
3291
|
+
const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
|
|
3292
|
+
while (reader.pos < end) {
|
|
3293
|
+
[fieldNo, wireType] = reader.tag();
|
|
3294
|
+
if (delimited && wireType == WireType.EndGroup) {
|
|
3295
|
+
break;
|
|
3296
|
+
}
|
|
3297
|
+
const field = message.findNumber(fieldNo);
|
|
3298
|
+
if (!field) {
|
|
3299
|
+
const data = reader.skip(wireType, fieldNo);
|
|
3300
|
+
if (options.readUnknownFields) {
|
|
3301
|
+
unknownFields.push({ no: fieldNo, wireType, data });
|
|
3302
|
+
}
|
|
3303
|
+
continue;
|
|
3304
|
+
}
|
|
3305
|
+
readField(message, reader, field, wireType, options);
|
|
3306
|
+
}
|
|
3307
|
+
if (delimited) {
|
|
3308
|
+
if (wireType != WireType.EndGroup || fieldNo !== lengthOrDelimitedFieldNo) {
|
|
3309
|
+
throw new Error(`invalid end group tag`);
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
if (unknownFields.length > 0) {
|
|
3313
|
+
message.setUnknown(unknownFields);
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
function readField(message, reader, field, wireType, options) {
|
|
3317
|
+
switch (field.fieldKind) {
|
|
3318
|
+
case "scalar":
|
|
3319
|
+
message.set(field, readScalar(reader, field.scalar));
|
|
3320
|
+
break;
|
|
3321
|
+
case "enum":
|
|
3322
|
+
message.set(field, readScalar(reader, ScalarType.INT32));
|
|
3323
|
+
break;
|
|
3324
|
+
case "message":
|
|
3325
|
+
message.set(field, readMessageField(reader, options, field, message.get(field)));
|
|
3326
|
+
break;
|
|
3327
|
+
case "list":
|
|
3328
|
+
readListField(reader, wireType, message.get(field), options);
|
|
3329
|
+
break;
|
|
3330
|
+
case "map":
|
|
3331
|
+
readMapEntry(reader, message.get(field), options);
|
|
3332
|
+
break;
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
function readMapEntry(reader, map, options) {
|
|
3336
|
+
const field = map.field();
|
|
3337
|
+
let key, val;
|
|
3338
|
+
const end = reader.pos + reader.uint32();
|
|
3339
|
+
while (reader.pos < end) {
|
|
3340
|
+
const [fieldNo] = reader.tag();
|
|
3341
|
+
switch (fieldNo) {
|
|
3342
|
+
case 1:
|
|
3343
|
+
key = readScalar(reader, field.mapKey);
|
|
3344
|
+
break;
|
|
3345
|
+
case 2:
|
|
3346
|
+
switch (field.mapKind) {
|
|
3347
|
+
case "scalar":
|
|
3348
|
+
val = readScalar(reader, field.scalar);
|
|
3349
|
+
break;
|
|
3350
|
+
case "enum":
|
|
3351
|
+
val = reader.int32();
|
|
3352
|
+
break;
|
|
3353
|
+
case "message":
|
|
3354
|
+
val = readMessageField(reader, options, field);
|
|
3355
|
+
break;
|
|
3356
|
+
}
|
|
3357
|
+
break;
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
if (key === void 0) {
|
|
3361
|
+
key = scalarZeroValue(field.mapKey, false);
|
|
3362
|
+
}
|
|
3363
|
+
if (val === void 0) {
|
|
3364
|
+
switch (field.mapKind) {
|
|
3365
|
+
case "scalar":
|
|
3366
|
+
val = scalarZeroValue(field.scalar, false);
|
|
3367
|
+
break;
|
|
3368
|
+
case "enum":
|
|
3369
|
+
val = field.enum.values[0].number;
|
|
3370
|
+
break;
|
|
3371
|
+
case "message":
|
|
3372
|
+
val = reflect(field.message, void 0, false);
|
|
3373
|
+
break;
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
map.set(key, val);
|
|
3377
|
+
}
|
|
3378
|
+
function readListField(reader, wireType, list, options) {
|
|
3379
|
+
var _a;
|
|
3380
|
+
const field = list.field();
|
|
3381
|
+
if (field.listKind === "message") {
|
|
3382
|
+
list.add(readMessageField(reader, options, field));
|
|
3383
|
+
return;
|
|
3384
|
+
}
|
|
3385
|
+
const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32;
|
|
3386
|
+
const packed = wireType == WireType.LengthDelimited && scalarType != ScalarType.STRING && scalarType != ScalarType.BYTES;
|
|
3387
|
+
if (!packed) {
|
|
3388
|
+
list.add(readScalar(reader, scalarType));
|
|
3389
|
+
return;
|
|
3390
|
+
}
|
|
3391
|
+
const e = reader.uint32() + reader.pos;
|
|
3392
|
+
while (reader.pos < e) {
|
|
3393
|
+
list.add(readScalar(reader, scalarType));
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
function readMessageField(reader, options, field, mergeMessage) {
|
|
3397
|
+
const delimited = field.delimitedEncoding;
|
|
3398
|
+
const message = mergeMessage !== null && mergeMessage !== void 0 ? mergeMessage : reflect(field.message, void 0, false);
|
|
3399
|
+
readMessage(message, reader, options, delimited, delimited ? field.number : reader.uint32());
|
|
3400
|
+
return message;
|
|
3401
|
+
}
|
|
3402
|
+
function readScalar(reader, type) {
|
|
3403
|
+
switch (type) {
|
|
3404
|
+
case ScalarType.STRING:
|
|
3405
|
+
return reader.string();
|
|
3406
|
+
case ScalarType.BOOL:
|
|
3407
|
+
return reader.bool();
|
|
3408
|
+
case ScalarType.DOUBLE:
|
|
3409
|
+
return reader.double();
|
|
3410
|
+
case ScalarType.FLOAT:
|
|
3411
|
+
return reader.float();
|
|
3412
|
+
case ScalarType.INT32:
|
|
3413
|
+
return reader.int32();
|
|
3414
|
+
case ScalarType.INT64:
|
|
3415
|
+
return reader.int64();
|
|
3416
|
+
case ScalarType.UINT64:
|
|
3417
|
+
return reader.uint64();
|
|
3418
|
+
case ScalarType.FIXED64:
|
|
3419
|
+
return reader.fixed64();
|
|
3420
|
+
case ScalarType.BYTES:
|
|
3421
|
+
return reader.bytes();
|
|
3422
|
+
case ScalarType.FIXED32:
|
|
3423
|
+
return reader.fixed32();
|
|
3424
|
+
case ScalarType.SFIXED32:
|
|
3425
|
+
return reader.sfixed32();
|
|
3426
|
+
case ScalarType.SFIXED64:
|
|
3427
|
+
return reader.sfixed64();
|
|
3428
|
+
case ScalarType.SINT64:
|
|
3429
|
+
return reader.sint64();
|
|
3430
|
+
case ScalarType.UINT32:
|
|
3431
|
+
return reader.uint32();
|
|
3432
|
+
case ScalarType.SINT32:
|
|
3433
|
+
return reader.sint32();
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
function fileDesc(b64, imports) {
|
|
3437
|
+
var _a;
|
|
3438
|
+
const root = fromBinary(FileDescriptorProtoSchema, base64Decode(b64));
|
|
3439
|
+
root.messageType.forEach(restoreJsonNames);
|
|
3440
|
+
root.dependency = (_a = imports === null || imports === void 0 ? void 0 : imports.map((f) => f.proto.name)) !== null && _a !== void 0 ? _a : [];
|
|
3441
|
+
const reg = createFileRegistry(root, (protoFileName) => imports === null || imports === void 0 ? void 0 : imports.find((f) => f.proto.name === protoFileName));
|
|
3442
|
+
return reg.getFile(root.name);
|
|
3443
|
+
}
|
|
3444
|
+
function serviceDesc(file, path, ...paths) {
|
|
3445
|
+
if (paths.length > 0) {
|
|
3446
|
+
throw new Error();
|
|
3447
|
+
}
|
|
3448
|
+
return file.services[path];
|
|
3449
|
+
}
|
|
3450
|
+
const file_streamlayer_common_streamlayer_common = /* @__PURE__ */ fileDesc("CitzdHJlYW1sYXllci9jb21tb24vc3RyZWFtbGF5ZXJfY29tbW9uLnByb3RvEhJzdHJlYW1sYXllci5jb21tb24iJgoIS2V5VmFsdWUSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJKroBChNQcm9wYWdhdGlvblN0cmF0ZWd5EiAKHFBST1BBR0FUSU9OX1NUUkFURUdZX0lOVkFMSUQQABIeChpQUk9QQUdBVElPTl9TVFJBVEVHWV9VTlNFVBABEh8KG1BST1BBR0FUSU9OX1NUUkFURUdZX0lHTk9SRRACEh4KGlBST1BBR0FUSU9OX1NUUkFURUdZX0FXQUlUEAMSIAocUFJPUEFHQVRJT05fU1RSQVRFR1lfUFVCTElTSBAEKqYBChBGYWlsb3ZlclN0cmF0ZWd5Eh0KGUZBSUxPVkVSX1NUUkFURUdZX0lOVkFMSUQQABIbChdGQUlMT1ZFUl9TVFJBVEVHWV9VTlNFVBABEhwKGEZBSUxPVkVSX1NUUkFURUdZX0lHTk9SRRACEhsKF0ZBSUxPVkVSX1NUUkFURUdZX0VBUkxZEAMSGwoXRkFJTE9WRVJfU1RSQVRFR1lfR1JBQ0UQBCqsAQoWQXV0aGVudGljYXRpb25TdHJhdGVneRIjCh9BVVRIRU5USUNBVElPTl9TVFJBVEVHWV9JTlZBTElEEAASIQodQVVUSEVOVElDQVRJT05fU1RSQVRFR1lfVU5TRVQQARIkCiBBVVRIRU5USUNBVElPTl9TVFJBVEVHWV9SRVFVSVJFRBACEiQKIEFVVEhFTlRJQ0FUSU9OX1NUUkFURUdZX09QVElPTkFMEAMq2AEKC0FjY2Vzc0xldmVsEhYKEkFDQ0VTU19MRVZFTF9VTlNFVBAAEhYKEkFDQ0VTU19MRVZFTF9PV05FUhABEhcKE0FDQ0VTU19MRVZFTF9DTElFTlQQAhIbChZBQ0NFU1NfTEVWRUxfTU9ERVJBVE9SENQWEhgKE0FDQ0VTU19MRVZFTF9WSUVXRVIQuBcSGAoTQUNDRVNTX0xFVkVMX01FTUJFUhCgHxIXChJBQ0NFU1NfTEVWRUxfQURNSU4QiCcSFgoRQUNDRVNTX0xFVkVMX1JPT1QQkE4qTQoRT3JnYW5pemF0aW9uU2NvcGUSHAoYT1JHQU5JWkFUSU9OX1NDT1BFX1VOU0VUEAASGgoWT1JHQU5JWkFUSU9OX1NDT1BFX1NFVBABOkMKC3JvdXRlUHJlZml4Eh8uZ29vZ2xlLnByb3RvYnVmLlNlcnZpY2VPcHRpb25zGNGGAyABKAlSC3JvdXRlUHJlZml4OjgKBmFjdGlvbhIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGOHUAyABKAlSBmFjdGlvbjp7ChNwcm9wYWdhdGlvblN0cmF0ZWd5Eh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMY4tQDIAEoDjInLnN0cmVhbWxheWVyLmNvbW1vbi5Qcm9wYWdhdGlvblN0cmF0ZWd5UhNwcm9wYWdhdGlvblN0cmF0ZWd5OnIKEGZhaWxvdmVyU3RyYXRlZ3kSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxjj1AMgASgOMiQuc3RyZWFtbGF5ZXIuY29tbW9uLkZhaWxvdmVyU3RyYXRlZ3lSEGZhaWxvdmVyU3RyYXRlZ3k6hAEKFmF1dGhlbnRpY2F0aW9uU3RyYXRlZ3kSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxjk1AMgASgOMiouc3RyZWFtbGF5ZXIuY29tbW9uLkF1dGhlbnRpY2F0aW9uU3RyYXRlZ3lSFmF1dGhlbnRpY2F0aW9uU3RyYXRlZ3k6YwoLYWNjZXNzTGV2ZWwSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxjl1AMgASgOMh8uc3RyZWFtbGF5ZXIuY29tbW9uLkFjY2Vzc0xldmVsUgthY2Nlc3NMZXZlbDp1ChFvcmdhbml6YXRpb25TY29wZRIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGObUAyABKA4yJS5zdHJlYW1sYXllci5jb21tb24uT3JnYW5pemF0aW9uU2NvcGVSEW9yZ2FuaXphdGlvblNjb3BlQogBChZjb20uc3RyZWFtbGF5ZXIuY29tbW9uQhZTdHJlYW1MYXllckNvbW1vblByb3RvUAFaS2dpdGh1Yi5jb20vc3RyZWFtbGF5ZXIvc2wtcHJvdG9maWxlcy8uYnVpbGQvZ28vc3RyZWFtbGF5ZXIvY29tbW9uO3NsX2NvbW1vbqICBlNMX0FQSWIGcHJvdG8z", [file_google_protobuf_descriptor]);
|
|
3451
|
+
var NotificationType;
|
|
3452
|
+
(function(NotificationType2) {
|
|
3453
|
+
NotificationType2[NotificationType2["ONBOARDING"] = 1] = "ONBOARDING";
|
|
3454
|
+
NotificationType2[NotificationType2["QUESTION"] = 2] = "QUESTION";
|
|
3455
|
+
NotificationType2[NotificationType2["QUESTION_RESOLVED"] = 3] = "QUESTION_RESOLVED";
|
|
3456
|
+
})(NotificationType || (NotificationType = {}));
|
|
3457
|
+
window.slStore = /* @__PURE__ */ Object.create(null);
|
|
3458
|
+
var FeatureSource;
|
|
3459
|
+
(function(FeatureSource2) {
|
|
3460
|
+
FeatureSource2["ORGANIZATION"] = "ORGANIZATION";
|
|
3461
|
+
FeatureSource2["STREAM"] = "STREAM";
|
|
3462
|
+
})(FeatureSource || (FeatureSource = {}));
|
|
720
3463
|
var FeatureStatus;
|
|
721
3464
|
(function(FeatureStatus2) {
|
|
722
3465
|
FeatureStatus2["Ready"] = "ready";
|
|
@@ -815,8 +3558,11 @@ createLogger("grpc:retry");
|
|
|
815
3558
|
retryAttempts: createContextKey(10, { description: "Number of attempts to retry" }),
|
|
816
3559
|
retryDelay: createContextKey(3e4, { description: "Max delay between retries in milliseconds" })
|
|
817
3560
|
});
|
|
3561
|
+
const file_streamlayer_users_users_common = /* @__PURE__ */ fileDesc("CiRzdHJlYW1sYXllci91c2Vycy91c2Vyc19jb21tb24ucHJvdG8SEXN0cmVhbWxheWVyLnVzZXJzIh4KDlB1YmxpY0NoYXRVc2VyEgwKBG5hbWUYASABKAkioAEKDlVzZXJBdHRyaWJ1dGVzEhAKCHVzZXJuYW1lGAEgASgJEgwKBG5hbWUYAiABKAkSDQoFYWxpYXMYAyABKAkSDgoGYXZhdGFyGAUgASgJEjoKC3B1YmxpY19jaGF0GAYgASgLMiEuc3RyZWFtbGF5ZXIudXNlcnMuUHVibGljQ2hhdFVzZXJCAhgBEhMKC3B1YmxpY19uYW1lGAcgASgJIjMKEFVzZXJPcmdhbml6YXRpb24SCgoCaWQYASABKAkSEwoLcGVybWlzc2lvbnMYAiADKAki/wEKDFVzZXJNZXRhZGF0YRIOCgZhdmF0YXIYAiABKAkSIAoYYXZhdGFyX2JhY2tncm91bmRfY29sb3VyGAMgASgJEhAKCHRpbWV6b25lGAQgASgJEk4KF25vdGlmaWNhdGlvbl9wcmVmZXJlbmNlGAUgASgOMi0uc3RyZWFtbGF5ZXIudXNlcnMuVXNlck5vdGlmaWNhdGlvblByZWZlcmVuY2USDgoGYWN0aXZlGAYgASgIEhIKCmZpcnN0X25hbWUYByABKAkSEQoJbGFzdF9uYW1lGAggASgJEg0KBXJvbGVzGAkgAygJEhUKDWF1ZGllbmNlX3RhZ3MYCiADKAkiegoWRXh0ZW5kZWRVc2VyQXR0cmlidXRlcxIQCgh1c2VybmFtZRgBIAEoCRIMCgRuYW1lGAIgASgJEg0KBWFsaWFzGAMgASgJEjEKCG1ldGFkYXRhGAQgASgLMh8uc3RyZWFtbGF5ZXIudXNlcnMuVXNlck1ldGFkYXRhIlcKBFVzZXISCgoCaWQYASABKAkSDAoEdHlwZRgCIAEoCRI1CgphdHRyaWJ1dGVzGAMgASgLMiEuc3RyZWFtbGF5ZXIudXNlcnMuVXNlckF0dHJpYnV0ZXMiZwoMRXh0ZW5kZWRVc2VyEgoKAmlkGAEgASgJEgwKBHR5cGUYAiABKAkSPQoKYXR0cmlidXRlcxgDIAEoCzIpLnN0cmVhbWxheWVyLnVzZXJzLkV4dGVuZGVkVXNlckF0dHJpYnV0ZXMq5gEKGlVzZXJOb3RpZmljYXRpb25QcmVmZXJlbmNlEiYKIlVTRVJfTk9USUZJQ0FUSU9OX1BSRUZFUkVOQ0VfVU5TRVQQABIrCidVU0VSX05PVElGSUNBVElPTl9QUkVGRVJFTkNFX0FMTF9FVkVOVFMQARI2CjJVU0VSX05PVElGSUNBVElPTl9QUkVGRVJFTkNFX0lNUE9SVEFOVF9FVkVOVFNfT05MWRACEjsKN1VTRVJfTk9USUZJQ0FUSU9OX1BSRUZFUkVOQ0VfREFJTFlfU1VNTUFSWV9BTkRfTUVOVElPTlMQA0KKAQoVY29tLnN0cmVhbWxheWVyLnVzZXJzQhtTdHJlYW1MYXllclVzZXJzQ29tbW9uUHJvdG9QAVpJZ2l0aHViLmNvbS9zdHJlYW1sYXllci9zbC1wcm90b2ZpbGVzLy5idWlsZC9nby9zdHJlYW1sYXllci91c2VycztzbF91c2Vyc6ICBlNMX0FQSWIGcHJvdG8z");
|
|
3562
|
+
const file_streamlayer_users_users = /* @__PURE__ */ fileDesc("Ch1zdHJlYW1sYXllci91c2Vycy91c2Vycy5wcm90bxIRc3RyZWFtbGF5ZXIudXNlcnMiLAoMTG9naW5SZXF1ZXN0EgoKAmlkGAEgASgJEhAKCHBhc3N3b3JkGAIgASgJIsMBCgxBdXRoUmVzcG9uc2USQgoEbWV0YRgBIAEoCzI0LnN0cmVhbWxheWVyLnVzZXJzLkF1dGhSZXNwb25zZS5BdXRoUmVzcG9uc2VNZXRhZGF0YRIlCgRkYXRhGAIgASgLMhcuc3RyZWFtbGF5ZXIudXNlcnMuVXNlchpIChRBdXRoUmVzcG9uc2VNZXRhZGF0YRILCgNqd3QYASABKAkSEQoJZ2V0c3RyZWFtGAMgASgJSgQIAhADUgp2b3hpbXBsYW50Ih0KD1JlZ2lzdGVyUmVxdWVzdBIKCgJpZBgBIAEoCSI7CghSZWZlcnJhbBIKCgJpZBgBIAEoCRIMCgRuYW1lGAIgASgJEhUKDXdhdGNoaW5nX2dhbWUYAyABKAkiagoQUmVnaXN0ZXJSZXNwb25zZRIKCgJpZBgBIAEoCRIbChNyZXF1aXJlc19hY3RpdmF0aW9uGAIgASgIEi0KCHJlZmVycmFsGAMgASgLMhsuc3RyZWFtbGF5ZXIudXNlcnMuUmVmZXJyYWwiJAoWUmVxdWVzdFBhc3N3b3JkUmVxdWVzdBIKCgJpZBgBIAEoCSI5ChdSZXF1ZXN0UGFzc3dvcmRSZXNwb25zZRIRCglyZXF1ZXN0ZWQYASABKAgSCwoDdWlkGAIgASgJIgsKCU1lUmVxdWVzdCIzCgpNZVJlc3BvbnNlEiUKBGRhdGEYASABKAsyFy5zdHJlYW1sYXllci51c2Vycy5Vc2VyIkcKFVVwZGF0ZU1ldGFkYXRhUmVxdWVzdBISCghzZXRfbmFtZRgBIAEoCUgAEhIKCGRlbF9uYW1lGAIgASgJSABCBgoEbmFtZSJdChNVcGRhdGVBdmF0YXJSZXF1ZXN0EhAKCHVzZXJuYW1lGAEgASgJEhQKCnNldF9hdmF0YXIYAiABKAlIABIUCgpkZWxfYXZhdGFyGAMgASgJSABCCAoGYXZhdGFyIhYKFFVwZGF0ZUF2YXRhclJlc3BvbnNlIl8KG1VwZGF0ZVB1YmxpY0NoYXROYW1lUmVxdWVzdBIQCgh1c2VybmFtZRgBIAEoCRISCghzZXRfbmFtZRgCIAEoCUgAEhIKCGRlbF9uYW1lGAMgASgJSABCBgoEbmFtZSIeChxVcGRhdGVQdWJsaWNDaGF0TmFtZVJlc3BvbnNlIlsKF1VwZGF0ZVB1YmxpY05hbWVSZXF1ZXN0EhAKCHVzZXJuYW1lGAEgASgJEhIKCHNldF9uYW1lGAIgASgJSAASEgoIZGVsX25hbWUYAyABKAlIAEIGCgRuYW1lIhoKGFVwZGF0ZVB1YmxpY05hbWVSZXNwb25zZSIYChZVcGRhdGVNZXRhZGF0YVJlc3BvbnNlIocBCg1JbnZpdGVSZXF1ZXN0EgoKAmlkGAEgASgJEkEKCHJlZmVycmFsGAIgASgLMi8uc3RyZWFtbGF5ZXIudXNlcnMuSW52aXRlUmVxdWVzdC5JbnZpdGVSZWZlcnJhbBonCg5JbnZpdGVSZWZlcnJhbBIVCg13YXRjaGluZ19nYW1lGAEgASgJIhAKDkludml0ZVJlc3BvbnNlIm0KEUJ5cGFzc0F1dGhSZXF1ZXN0EhAKCHVzZXJfa2V5GAEgASgJEg4KBnNjaGVtYRgCIAEoCRIMCgRpbml0GAMgASgIEhgKC2ludml0ZXJfa2V5GAQgASgJSACIAQFCDgoMX2ludml0ZXJfa2V5IrMCChJCeXBhc3NBdXRoUmVzcG9uc2USSAoEbWV0YRgBIAEoCzI6LnN0cmVhbWxheWVyLnVzZXJzLkJ5cGFzc0F1dGhSZXNwb25zZS5BdXRoUmVzcG9uc2VNZXRhZGF0YRIqCgRkYXRhGAIgASgLMhcuc3RyZWFtbGF5ZXIudXNlcnMuVXNlckgAiAEBGp0BChRBdXRoUmVzcG9uc2VNZXRhZGF0YRIQCgNqd3QYASABKAlIAIgBARISCgV0b2tlbhgDIAEoCUgBiAEBEhEKCWdldHN0cmVhbRgEIAEoCRIYCgtpbnZpdGVyX2tleRgFIAEoCUgCiAEBQgYKBF9qd3RCCAoGX3Rva2VuQg4KDF9pbnZpdGVyX2tleUoECAIQA1IKdm94aW1wbGFudEIHCgVfZGF0YSJjChFHZXRGcmllbmRzUmVxdWVzdBIcCg9sYXN0X2NyZWF0ZWRfYXQYASABKAlIAIgBARISCgVsaW1pdBgCIAEoBUgBiAEBQhIKEF9sYXN0X2NyZWF0ZWRfYXRCCAoGX2xpbWl0IoECChJHZXRGcmllbmRzUmVzcG9uc2USPgoEZGF0YRgBIAMoCzIwLnN0cmVhbWxheWVyLnVzZXJzLkdldEZyaWVuZHNSZXNwb25zZS5GcmllbmREYXRhEkQKCG1ldGFkYXRhGAIgASgLMjIuc3RyZWFtbGF5ZXIudXNlcnMuR2V0RnJpZW5kc1Jlc3BvbnNlLlJlc3BvbnNlTWV0YRonCgxSZXNwb25zZU1ldGESFwoPbGFzdF9jcmVhdGVkX2F0GAEgASgJGjwKCkZyaWVuZERhdGESDAoEbmFtZRgBIAEoCRIRCgl0aW5vZGVfaWQYAiABKAkSDQoFc2xfaWQYAyABKAkiFwoVR2VuZXJhdGVNZmFLZXlSZXF1ZXN0IigKFkdlbmVyYXRlTWZhS2V5UmVzcG9uc2USDgoGc2VjcmV0GAEgASgJIjQKEEF0dGFjaE1mYVJlcXVlc3QSEAoIdXNlcm5hbWUYASABKAkSDgoGc2VjcmV0GAIgASgJIiQKEUF0dGFjaE1mYVJlc3BvbnNlEg8KB2VuYWJsZWQYASABKAgiMgoQRGV0YWNoTWZhUmVxdWVzdBIQCgh1c2VybmFtZRgBIAEoCRIMCgR0b3RwGAIgASgJIiQKEURldGFjaE1mYVJlc3BvbnNlEg8KB2VuYWJsZWQYASABKAgiMgoQVmVyaWZ5TWZhUmVxdWVzdBIQCgh1c2VybmFtZRgBIAEoCRIMCgR0b3RwGAIgASgJIiIKEVZlcmlmeU1mYVJlc3BvbnNlEg0KBXZhbGlkGAEgASgIMo8NCgVVc2VycxJJCgVMb2dpbhIfLnN0cmVhbWxheWVyLnVzZXJzLkxvZ2luUmVxdWVzdBofLnN0cmVhbWxheWVyLnVzZXJzLkF1dGhSZXNwb25zZRJTCghSZWdpc3RlchIiLnN0cmVhbWxheWVyLnVzZXJzLlJlZ2lzdGVyUmVxdWVzdBojLnN0cmVhbWxheWVyLnVzZXJzLlJlZ2lzdGVyUmVzcG9uc2USgQEKD1JlcXVlc3RQYXNzd29yZBIpLnN0cmVhbWxheWVyLnVzZXJzLlJlcXVlc3RQYXNzd29yZFJlcXVlc3QaKi5zdHJlYW1sYXllci51c2Vycy5SZXF1ZXN0UGFzc3dvcmRSZXNwb25zZSIXiqYdE2Rpc3Bvc2FibGUtcGFzc3dvcmQSSwoCTWUSHC5zdHJlYW1sYXllci51c2Vycy5NZVJlcXVlc3QaHS5zdHJlYW1sYXllci51c2Vycy5NZVJlc3BvbnNlIgiQph0CoKYdAhJfCgZJbnZpdGUSIC5zdHJlYW1sYXllci51c2Vycy5JbnZpdGVSZXF1ZXN0GiEuc3RyZWFtbGF5ZXIudXNlcnMuSW52aXRlUmVzcG9uc2UiEIqmHQhyZWZlcnJhbKCmHQISagoKQnlwYXNzQXV0aBIkLnN0cmVhbWxheWVyLnVzZXJzLkJ5cGFzc0F1dGhSZXF1ZXN0GiUuc3RyZWFtbGF5ZXIudXNlcnMuQnlwYXNzQXV0aFJlc3BvbnNlIg+Kph0LYXV0aC1ieXBhc3MSfQoOVXBkYXRlTWV0YWRhdGESKC5zdHJlYW1sYXllci51c2Vycy5VcGRhdGVNZXRhZGF0YVJlcXVlc3QaKS5zdHJlYW1sYXllci51c2Vycy5VcGRhdGVNZXRhZGF0YVJlc3BvbnNlIhaKph0OdXBkYXRlTWV0YWRhdGGgph0CEncKDFVwZGF0ZUF2YXRhchImLnN0cmVhbWxheWVyLnVzZXJzLlVwZGF0ZUF2YXRhclJlcXVlc3QaJy5zdHJlYW1sYXllci51c2Vycy5VcGRhdGVBdmF0YXJSZXNwb25zZSIWiqYdDnVwZGF0ZU1ldGFkYXRhoKYdAhKPAQoUVXBkYXRlUHVibGljQ2hhdE5hbWUSLi5zdHJlYW1sYXllci51c2Vycy5VcGRhdGVQdWJsaWNDaGF0TmFtZVJlcXVlc3QaLy5zdHJlYW1sYXllci51c2Vycy5VcGRhdGVQdWJsaWNDaGF0TmFtZVJlc3BvbnNlIhaKph0OdXBkYXRlTWV0YWRhdGGgph0CEoMBChBVcGRhdGVQdWJsaWNOYW1lEiouc3RyZWFtbGF5ZXIudXNlcnMuVXBkYXRlUHVibGljTmFtZVJlcXVlc3QaKy5zdHJlYW1sYXllci51c2Vycy5VcGRhdGVQdWJsaWNOYW1lUmVzcG9uc2UiFoqmHQ51cGRhdGVNZXRhZGF0YaCmHQISbQoKR2V0RnJpZW5kcxIkLnN0cmVhbWxheWVyLnVzZXJzLkdldEZyaWVuZHNSZXF1ZXN0GiUuc3RyZWFtbGF5ZXIudXNlcnMuR2V0RnJpZW5kc1Jlc3BvbnNlIhKKph0KZ2V0RnJpZW5kc6CmHQISfQoOR2VuZXJhdGVNZmFLZXkSKC5zdHJlYW1sYXllci51c2Vycy5HZW5lcmF0ZU1mYUtleVJlcXVlc3QaKS5zdHJlYW1sYXllci51c2Vycy5HZW5lcmF0ZU1mYUtleVJlc3BvbnNlIhaKph0OZ2VuZXJhdGVNZmFLZXmgph0CEmkKCUF0dGFjaE1mYRIjLnN0cmVhbWxheWVyLnVzZXJzLkF0dGFjaE1mYVJlcXVlc3QaJC5zdHJlYW1sYXllci51c2Vycy5BdHRhY2hNZmFSZXNwb25zZSIRiqYdCWF0dGFjaE1mYaCmHQISaQoJRGV0YWNoTWZhEiMuc3RyZWFtbGF5ZXIudXNlcnMuRGV0YWNoTWZhUmVxdWVzdBokLnN0cmVhbWxheWVyLnVzZXJzLkRldGFjaE1mYVJlc3BvbnNlIhGKph0JZGV0YWNoTWZhoKYdAhJpCglWZXJpZnlNZmESIy5zdHJlYW1sYXllci51c2Vycy5WZXJpZnlNZmFSZXF1ZXN0GiQuc3RyZWFtbGF5ZXIudXNlcnMuVmVyaWZ5TWZhUmVzcG9uc2UiEYqmHQl2ZXJpZnlNZmGgph0CGgmKtRgFdXNlcnNChAEKFWNvbS5zdHJlYW1sYXllci51c2Vyc0IVU3RyZWFtTGF5ZXJVc2Vyc1Byb3RvUAFaSWdpdGh1Yi5jb20vc3RyZWFtbGF5ZXIvc2wtcHJvdG9maWxlcy8uYnVpbGQvZ28vc3RyZWFtbGF5ZXIvdXNlcnM7c2xfdXNlcnOiAgZTTF9BUEliBnByb3RvMw", [file_streamlayer_common_streamlayer_common, file_streamlayer_users_users_common]);
|
|
3563
|
+
const Users = /* @__PURE__ */ serviceDesc(file_streamlayer_users_users, 0);
|
|
818
3564
|
const bypassAuth = (transport, params) => {
|
|
819
|
-
const { client, createRequestOptions } = transport.createPromiseClient(
|
|
3565
|
+
const { client, createRequestOptions } = transport.createPromiseClient(Users, { method: "bypassAuth" });
|
|
820
3566
|
const contextValues = createRequestOptions({ retryAttempts: 0 });
|
|
821
3567
|
return client.bypassAuth(params, { contextValues });
|
|
822
3568
|
};
|