@yorkie-js/sdk 0.6.5 → 0.6.6

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.
@@ -3441,6 +3441,7 @@ function makeAnyClient(service, createMethod) {
3441
3441
  }
3442
3442
  return client;
3443
3443
  }
3444
+ const compressedFlag = 1;
3444
3445
  function createEnvelopeReadableStream(stream) {
3445
3446
  let reader;
3446
3447
  let buffer = new Uint8Array(0);
@@ -3655,7 +3656,7 @@ var __asyncGenerator$1 = function(thisArg, _arguments, generator) {
3655
3656
  if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
3656
3657
  }
3657
3658
  };
3658
- function createPromiseClient(service, transport) {
3659
+ function createClient(service, transport) {
3659
3660
  return makeAnyClient(service, (method) => {
3660
3661
  switch (method.kind) {
3661
3662
  case MethodKind.Unary:
@@ -3671,6 +3672,9 @@ function createPromiseClient(service, transport) {
3671
3672
  }
3672
3673
  });
3673
3674
  }
3675
+ function createPromiseClient(service, transport) {
3676
+ return createClient(service, transport);
3677
+ }
3674
3678
  function createUnaryFn(transport, service, method) {
3675
3679
  return async function(input, options) {
3676
3680
  var _a2, _b2;
@@ -3692,12 +3696,14 @@ function createClientStreamingFn(transport, service, method) {
3692
3696
  const response = await transport.stream(service, method, options === null || options === void 0 ? void 0 : options.signal, options === null || options === void 0 ? void 0 : options.timeoutMs, options === null || options === void 0 ? void 0 : options.headers, request, options === null || options === void 0 ? void 0 : options.contextValues);
3693
3697
  (_d2 = options === null || options === void 0 ? void 0 : options.onHeader) === null || _d2 === void 0 ? void 0 : _d2.call(options, response.header);
3694
3698
  let singleMessage;
3699
+ let count = 0;
3695
3700
  try {
3696
3701
  for (var _f2 = true, _g2 = __asyncValues(response.message), _h2; _h2 = await _g2.next(), _a2 = _h2.done, !_a2; _f2 = true) {
3697
3702
  _c2 = _h2.value;
3698
3703
  _f2 = false;
3699
3704
  const message = _c2;
3700
3705
  singleMessage = message;
3706
+ count++;
3701
3707
  }
3702
3708
  } catch (e_1_1) {
3703
3709
  e_1 = { error: e_1_1 };
@@ -3709,7 +3715,10 @@ function createClientStreamingFn(transport, service, method) {
3709
3715
  }
3710
3716
  }
3711
3717
  if (!singleMessage) {
3712
- throw new ConnectError("protocol error: missing response message", Code$1.Internal);
3718
+ throw new ConnectError("protocol error: missing response message", Code$1.Unimplemented);
3719
+ }
3720
+ if (count > 1) {
3721
+ throw new ConnectError("protocol error: received extra messages for client streaming method", Code$1.Unimplemented);
3713
3722
  }
3714
3723
  (_e2 = options === null || options === void 0 ? void 0 : options.onTrailer) === null || _e2 === void 0 ? void 0 : _e2.call(options, response.trailer);
3715
3724
  return singleMessage;
@@ -3722,8 +3731,8 @@ function createBiDiStreamingFn(transport, service, method) {
3722
3731
  }
3723
3732
  function handleStreamResponse(stream, options) {
3724
3733
  const it = function() {
3725
- var _a2, _b2;
3726
3734
  return __asyncGenerator$1(this, arguments, function* () {
3735
+ var _a2, _b2;
3727
3736
  const response = yield __await$1(stream);
3728
3737
  (_a2 = options === null || options === void 0 ? void 0 : options.onHeader) === null || _a2 === void 0 ? void 0 : _a2.call(options, response.header);
3729
3738
  yield __await$1(yield* __asyncDelegator(__asyncValues(response.message)));
@@ -3954,7 +3963,7 @@ function createBinarySerialization(messageType, options) {
3954
3963
  return messageType.fromBinary(data, options);
3955
3964
  } catch (e) {
3956
3965
  const m = e instanceof Error ? e.message : String(e);
3957
- throw new ConnectError(`parse binary: ${m}`, Code$1.InvalidArgument);
3966
+ throw new ConnectError(`parse binary: ${m}`, Code$1.Internal);
3958
3967
  }
3959
3968
  },
3960
3969
  serialize(data) {
@@ -4067,12 +4076,15 @@ function validateTrailer(trailer, header) {
4067
4076
  });
4068
4077
  throw err;
4069
4078
  }
4079
+ if (!header.has(headerGrpcStatus) && !trailer.has(headerGrpcStatus)) {
4080
+ throw new ConnectError("protocol error: missing status", Code$1.Internal);
4081
+ }
4070
4082
  }
4071
4083
  function requestHeader(useBinaryFormat, timeoutMs, userProvidedHeaders, setUserAgent) {
4072
4084
  const result = new Headers(userProvidedHeaders !== null && userProvidedHeaders !== void 0 ? userProvidedHeaders : {});
4073
4085
  result.set(headerContentType, useBinaryFormat ? contentTypeProto : contentTypeJson);
4074
4086
  result.set(headerXGrpcWeb, "1");
4075
- result.set(headerXUserAgent, "connect-es/1.4.0");
4087
+ result.set(headerXUserAgent, "connect-es/1.6.1");
4076
4088
  if (timeoutMs !== void 0) {
4077
4089
  result.set(headerTimeout, `${timeoutMs}m`);
4078
4090
  }
@@ -4103,11 +4115,10 @@ function codeFromHttpStatus(httpStatus) {
4103
4115
  function validateResponse(status, headers) {
4104
4116
  var _a2;
4105
4117
  if (status >= 200 && status < 300) {
4106
- const err = findTrailerError(headers);
4107
- if (err) {
4108
- throw err;
4109
- }
4110
- return { foundStatus: headers.has(headerGrpcStatus) };
4118
+ return {
4119
+ foundStatus: headers.has(headerGrpcStatus),
4120
+ headerError: findTrailerError(headers)
4121
+ };
4111
4122
  }
4112
4123
  throw new ConnectError(decodeURIComponent((_a2 = headers.get(headerGrpcMessage)) !== null && _a2 !== void 0 ? _a2 : `HTTP ${status}`), codeFromHttpStatus(status), headers);
4113
4124
  }
@@ -4187,8 +4198,10 @@ function createGrpcWebTransport(options) {
4187
4198
  var _a4;
4188
4199
  const fetch2 = (_a4 = options.fetch) !== null && _a4 !== void 0 ? _a4 : globalThis.fetch;
4189
4200
  const response = await fetch2(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: encodeEnvelope(0, serialize(req.message)) }));
4190
- validateResponse(response.status, response.headers);
4201
+ const { headerError } = validateResponse(response.status, response.headers);
4191
4202
  if (!response.body) {
4203
+ if (headerError !== void 0)
4204
+ throw headerError;
4192
4205
  throw "missing response body";
4193
4206
  }
4194
4207
  const reader = createEnvelopeReadableStream(response.body).getReader();
@@ -4200,6 +4213,9 @@ function createGrpcWebTransport(options) {
4200
4213
  break;
4201
4214
  }
4202
4215
  const { flags, data } = r.value;
4216
+ if ((flags & compressedFlag) === compressedFlag) {
4217
+ throw new ConnectError(`protocol error: received unsupported compressed output`, Code$1.Internal);
4218
+ }
4203
4219
  if (flags === trailerFlag) {
4204
4220
  if (trailer !== void 0) {
4205
4221
  throw "extra trailer";
@@ -4208,16 +4224,18 @@ function createGrpcWebTransport(options) {
4208
4224
  continue;
4209
4225
  }
4210
4226
  if (message2 !== void 0) {
4211
- throw "extra message";
4227
+ throw new ConnectError("extra message", Code$1.Unimplemented);
4212
4228
  }
4213
4229
  message2 = parse(data);
4214
4230
  }
4215
4231
  if (trailer === void 0) {
4216
- throw "missing trailer";
4232
+ if (headerError !== void 0)
4233
+ throw headerError;
4234
+ throw new ConnectError("missing trailer", response.headers.has(headerGrpcStatus) ? Code$1.Unimplemented : Code$1.Unknown);
4217
4235
  }
4218
4236
  validateTrailer(trailer, response.headers);
4219
4237
  if (message2 === void 0) {
4220
- throw "missing message";
4238
+ throw new ConnectError("missing message", trailer.has(headerGrpcStatus) ? Code$1.Unimplemented : Code$1.Unknown);
4221
4239
  }
4222
4240
  return {
4223
4241
  stream: false,
@@ -4233,7 +4251,7 @@ function createGrpcWebTransport(options) {
4233
4251
  async stream(service, method, signal, timeoutMs, header, input, contextValues) {
4234
4252
  var _a3;
4235
4253
  const { serialize, parse } = createClientMethodSerializers(method, useBinaryFormat, options.jsonOptions, options.binaryOptions);
4236
- function parseResponseBody(body, foundStatus, trailerTarget, header2) {
4254
+ function parseResponseBody(body, foundStatus, trailerTarget, header2, signal2) {
4237
4255
  return __asyncGenerator(this, arguments, function* parseResponseBody_1() {
4238
4256
  const reader = createEnvelopeReadableStream(body).getReader();
4239
4257
  if (foundStatus) {
@@ -4263,7 +4281,9 @@ function createGrpcWebTransport(options) {
4263
4281
  throw "extra message";
4264
4282
  }
4265
4283
  yield yield __await(parse(data));
4266
- continue;
4284
+ }
4285
+ if ("throwIfAborted" in signal2) {
4286
+ signal2.throwIfAborted();
4267
4287
  }
4268
4288
  if (!trailerReceived) {
4269
4289
  throw "missing trailer";
@@ -4304,12 +4324,15 @@ function createGrpcWebTransport(options) {
4304
4324
  var _a4;
4305
4325
  const fetch2 = (_a4 = options.fetch) !== null && _a4 !== void 0 ? _a4 : globalThis.fetch;
4306
4326
  const fRes = await fetch2(req.url, Object.assign(Object.assign({}, req.init), { headers: req.header, signal: req.signal, body: await createRequestBody(req.message) }));
4307
- const { foundStatus } = validateResponse(fRes.status, fRes.headers);
4327
+ const { foundStatus, headerError } = validateResponse(fRes.status, fRes.headers);
4328
+ if (headerError != void 0) {
4329
+ throw headerError;
4330
+ }
4308
4331
  if (!fRes.body) {
4309
4332
  throw "missing response body";
4310
4333
  }
4311
4334
  const trailer = new Headers();
4312
- const res = Object.assign(Object.assign({}, req), { header: fRes.headers, trailer, message: parseResponseBody(fRes.body, foundStatus, trailer, fRes.headers) });
4335
+ const res = Object.assign(Object.assign({}, req), { header: fRes.headers, trailer, message: parseResponseBody(fRes.body, foundStatus, trailer, fRes.headers, req.signal) });
4313
4336
  return res;
4314
4337
  }
4315
4338
  });
@@ -7410,7 +7433,15 @@ const BadRequest_FieldViolation = proto3.makeMessageType(
7410
7433
  kind: "scalar",
7411
7434
  T: 9
7412
7435
  /* ScalarType.STRING */
7413
- }
7436
+ },
7437
+ {
7438
+ no: 3,
7439
+ name: "reason",
7440
+ kind: "scalar",
7441
+ T: 9
7442
+ /* ScalarType.STRING */
7443
+ },
7444
+ { no: 4, name: "localized_message", kind: "message", T: LocalizedMessage }
7414
7445
  ],
7415
7446
  { localName: "BadRequest_FieldViolation" }
7416
7447
  );
@@ -7492,7 +7523,7 @@ const Help_Link = proto3.makeMessageType(
7492
7523
  ],
7493
7524
  { localName: "Help_Link" }
7494
7525
  );
7495
- proto3.makeMessageType(
7526
+ const LocalizedMessage = proto3.makeMessageType(
7496
7527
  "google.rpc.LocalizedMessage",
7497
7528
  () => [
7498
7529
  {
@@ -8657,295 +8688,328 @@ class SplayTree {
8657
8688
  */
8658
8689
  var wasm = null;
8659
8690
  try {
8660
- wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([
8661
- 0,
8662
- 97,
8663
- 115,
8664
- 109,
8665
- 1,
8666
- 0,
8667
- 0,
8668
- 0,
8669
- 1,
8670
- 13,
8671
- 2,
8672
- 96,
8673
- 0,
8674
- 1,
8675
- 127,
8676
- 96,
8677
- 4,
8678
- 127,
8679
- 127,
8680
- 127,
8681
- 127,
8682
- 1,
8683
- 127,
8684
- 3,
8685
- 7,
8686
- 6,
8687
- 0,
8688
- 1,
8689
- 1,
8690
- 1,
8691
- 1,
8692
- 1,
8693
- 6,
8694
- 6,
8695
- 1,
8696
- 127,
8697
- 1,
8698
- 65,
8699
- 0,
8700
- 11,
8701
- 7,
8702
- 50,
8703
- 6,
8704
- 3,
8705
- 109,
8706
- 117,
8707
- 108,
8708
- 0,
8709
- 1,
8710
- 5,
8711
- 100,
8712
- 105,
8713
- 118,
8714
- 95,
8715
- 115,
8716
- 0,
8717
- 2,
8718
- 5,
8719
- 100,
8720
- 105,
8721
- 118,
8722
- 95,
8723
- 117,
8724
- 0,
8725
- 3,
8726
- 5,
8727
- 114,
8728
- 101,
8729
- 109,
8730
- 95,
8731
- 115,
8732
- 0,
8733
- 4,
8734
- 5,
8735
- 114,
8736
- 101,
8737
- 109,
8738
- 95,
8739
- 117,
8740
- 0,
8741
- 5,
8742
- 8,
8743
- 103,
8744
- 101,
8745
- 116,
8746
- 95,
8747
- 104,
8748
- 105,
8749
- 103,
8750
- 104,
8751
- 0,
8752
- 0,
8753
- 10,
8754
- 191,
8755
- 1,
8756
- 6,
8757
- 4,
8758
- 0,
8759
- 35,
8760
- 0,
8761
- 11,
8762
- 36,
8763
- 1,
8764
- 1,
8765
- 126,
8766
- 32,
8767
- 0,
8768
- 173,
8769
- 32,
8770
- 1,
8771
- 173,
8772
- 66,
8773
- 32,
8774
- 134,
8775
- 132,
8776
- 32,
8777
- 2,
8778
- 173,
8779
- 32,
8780
- 3,
8781
- 173,
8782
- 66,
8783
- 32,
8784
- 134,
8785
- 132,
8786
- 126,
8787
- 34,
8788
- 4,
8789
- 66,
8790
- 32,
8791
- 135,
8792
- 167,
8793
- 36,
8794
- 0,
8795
- 32,
8796
- 4,
8797
- 167,
8798
- 11,
8799
- 36,
8800
- 1,
8801
- 1,
8802
- 126,
8803
- 32,
8804
- 0,
8805
- 173,
8806
- 32,
8807
- 1,
8808
- 173,
8809
- 66,
8810
- 32,
8811
- 134,
8812
- 132,
8813
- 32,
8814
- 2,
8815
- 173,
8816
- 32,
8817
- 3,
8818
- 173,
8819
- 66,
8820
- 32,
8821
- 134,
8822
- 132,
8823
- 127,
8824
- 34,
8825
- 4,
8826
- 66,
8827
- 32,
8828
- 135,
8829
- 167,
8830
- 36,
8831
- 0,
8832
- 32,
8833
- 4,
8834
- 167,
8835
- 11,
8836
- 36,
8837
- 1,
8838
- 1,
8839
- 126,
8840
- 32,
8841
- 0,
8842
- 173,
8843
- 32,
8844
- 1,
8845
- 173,
8846
- 66,
8847
- 32,
8848
- 134,
8849
- 132,
8850
- 32,
8851
- 2,
8852
- 173,
8853
- 32,
8854
- 3,
8855
- 173,
8856
- 66,
8857
- 32,
8858
- 134,
8859
- 132,
8860
- 128,
8861
- 34,
8862
- 4,
8863
- 66,
8864
- 32,
8865
- 135,
8866
- 167,
8867
- 36,
8868
- 0,
8869
- 32,
8870
- 4,
8871
- 167,
8872
- 11,
8873
- 36,
8874
- 1,
8875
- 1,
8876
- 126,
8877
- 32,
8878
- 0,
8879
- 173,
8880
- 32,
8881
- 1,
8882
- 173,
8883
- 66,
8884
- 32,
8885
- 134,
8886
- 132,
8887
- 32,
8888
- 2,
8889
- 173,
8890
- 32,
8891
- 3,
8892
- 173,
8893
- 66,
8894
- 32,
8895
- 134,
8896
- 132,
8897
- 129,
8898
- 34,
8899
- 4,
8900
- 66,
8901
- 32,
8902
- 135,
8903
- 167,
8904
- 36,
8905
- 0,
8906
- 32,
8907
- 4,
8908
- 167,
8909
- 11,
8910
- 36,
8911
- 1,
8912
- 1,
8913
- 126,
8914
- 32,
8915
- 0,
8916
- 173,
8917
- 32,
8918
- 1,
8919
- 173,
8920
- 66,
8921
- 32,
8922
- 134,
8923
- 132,
8924
- 32,
8925
- 2,
8926
- 173,
8927
- 32,
8928
- 3,
8929
- 173,
8930
- 66,
8931
- 32,
8932
- 134,
8933
- 132,
8934
- 130,
8935
- 34,
8936
- 4,
8937
- 66,
8938
- 32,
8939
- 135,
8940
- 167,
8941
- 36,
8942
- 0,
8943
- 32,
8944
- 4,
8945
- 167,
8946
- 11
8947
- ])), {}).exports;
8948
- } catch (e) {
8691
+ wasm = new WebAssembly.Instance(
8692
+ new WebAssembly.Module(
8693
+ new Uint8Array([
8694
+ // \0asm
8695
+ 0,
8696
+ 97,
8697
+ 115,
8698
+ 109,
8699
+ // version 1
8700
+ 1,
8701
+ 0,
8702
+ 0,
8703
+ 0,
8704
+ // section "type"
8705
+ 1,
8706
+ 13,
8707
+ 2,
8708
+ // 0, () => i32
8709
+ 96,
8710
+ 0,
8711
+ 1,
8712
+ 127,
8713
+ // 1, (i32, i32, i32, i32) => i32
8714
+ 96,
8715
+ 4,
8716
+ 127,
8717
+ 127,
8718
+ 127,
8719
+ 127,
8720
+ 1,
8721
+ 127,
8722
+ // section "function"
8723
+ 3,
8724
+ 7,
8725
+ 6,
8726
+ // 0, type 0
8727
+ 0,
8728
+ // 1, type 1
8729
+ 1,
8730
+ // 2, type 1
8731
+ 1,
8732
+ // 3, type 1
8733
+ 1,
8734
+ // 4, type 1
8735
+ 1,
8736
+ // 5, type 1
8737
+ 1,
8738
+ // section "global"
8739
+ 6,
8740
+ 6,
8741
+ 1,
8742
+ // 0, "high", mutable i32
8743
+ 127,
8744
+ 1,
8745
+ 65,
8746
+ 0,
8747
+ 11,
8748
+ // section "export"
8749
+ 7,
8750
+ 50,
8751
+ 6,
8752
+ // 0, "mul"
8753
+ 3,
8754
+ 109,
8755
+ 117,
8756
+ 108,
8757
+ 0,
8758
+ 1,
8759
+ // 1, "div_s"
8760
+ 5,
8761
+ 100,
8762
+ 105,
8763
+ 118,
8764
+ 95,
8765
+ 115,
8766
+ 0,
8767
+ 2,
8768
+ // 2, "div_u"
8769
+ 5,
8770
+ 100,
8771
+ 105,
8772
+ 118,
8773
+ 95,
8774
+ 117,
8775
+ 0,
8776
+ 3,
8777
+ // 3, "rem_s"
8778
+ 5,
8779
+ 114,
8780
+ 101,
8781
+ 109,
8782
+ 95,
8783
+ 115,
8784
+ 0,
8785
+ 4,
8786
+ // 4, "rem_u"
8787
+ 5,
8788
+ 114,
8789
+ 101,
8790
+ 109,
8791
+ 95,
8792
+ 117,
8793
+ 0,
8794
+ 5,
8795
+ // 5, "get_high"
8796
+ 8,
8797
+ 103,
8798
+ 101,
8799
+ 116,
8800
+ 95,
8801
+ 104,
8802
+ 105,
8803
+ 103,
8804
+ 104,
8805
+ 0,
8806
+ 0,
8807
+ // section "code"
8808
+ 10,
8809
+ 191,
8810
+ 1,
8811
+ 6,
8812
+ // 0, "get_high"
8813
+ 4,
8814
+ 0,
8815
+ 35,
8816
+ 0,
8817
+ 11,
8818
+ // 1, "mul"
8819
+ 36,
8820
+ 1,
8821
+ 1,
8822
+ 126,
8823
+ 32,
8824
+ 0,
8825
+ 173,
8826
+ 32,
8827
+ 1,
8828
+ 173,
8829
+ 66,
8830
+ 32,
8831
+ 134,
8832
+ 132,
8833
+ 32,
8834
+ 2,
8835
+ 173,
8836
+ 32,
8837
+ 3,
8838
+ 173,
8839
+ 66,
8840
+ 32,
8841
+ 134,
8842
+ 132,
8843
+ 126,
8844
+ 34,
8845
+ 4,
8846
+ 66,
8847
+ 32,
8848
+ 135,
8849
+ 167,
8850
+ 36,
8851
+ 0,
8852
+ 32,
8853
+ 4,
8854
+ 167,
8855
+ 11,
8856
+ // 2, "div_s"
8857
+ 36,
8858
+ 1,
8859
+ 1,
8860
+ 126,
8861
+ 32,
8862
+ 0,
8863
+ 173,
8864
+ 32,
8865
+ 1,
8866
+ 173,
8867
+ 66,
8868
+ 32,
8869
+ 134,
8870
+ 132,
8871
+ 32,
8872
+ 2,
8873
+ 173,
8874
+ 32,
8875
+ 3,
8876
+ 173,
8877
+ 66,
8878
+ 32,
8879
+ 134,
8880
+ 132,
8881
+ 127,
8882
+ 34,
8883
+ 4,
8884
+ 66,
8885
+ 32,
8886
+ 135,
8887
+ 167,
8888
+ 36,
8889
+ 0,
8890
+ 32,
8891
+ 4,
8892
+ 167,
8893
+ 11,
8894
+ // 3, "div_u"
8895
+ 36,
8896
+ 1,
8897
+ 1,
8898
+ 126,
8899
+ 32,
8900
+ 0,
8901
+ 173,
8902
+ 32,
8903
+ 1,
8904
+ 173,
8905
+ 66,
8906
+ 32,
8907
+ 134,
8908
+ 132,
8909
+ 32,
8910
+ 2,
8911
+ 173,
8912
+ 32,
8913
+ 3,
8914
+ 173,
8915
+ 66,
8916
+ 32,
8917
+ 134,
8918
+ 132,
8919
+ 128,
8920
+ 34,
8921
+ 4,
8922
+ 66,
8923
+ 32,
8924
+ 135,
8925
+ 167,
8926
+ 36,
8927
+ 0,
8928
+ 32,
8929
+ 4,
8930
+ 167,
8931
+ 11,
8932
+ // 4, "rem_s"
8933
+ 36,
8934
+ 1,
8935
+ 1,
8936
+ 126,
8937
+ 32,
8938
+ 0,
8939
+ 173,
8940
+ 32,
8941
+ 1,
8942
+ 173,
8943
+ 66,
8944
+ 32,
8945
+ 134,
8946
+ 132,
8947
+ 32,
8948
+ 2,
8949
+ 173,
8950
+ 32,
8951
+ 3,
8952
+ 173,
8953
+ 66,
8954
+ 32,
8955
+ 134,
8956
+ 132,
8957
+ 129,
8958
+ 34,
8959
+ 4,
8960
+ 66,
8961
+ 32,
8962
+ 135,
8963
+ 167,
8964
+ 36,
8965
+ 0,
8966
+ 32,
8967
+ 4,
8968
+ 167,
8969
+ 11,
8970
+ // 5, "rem_u"
8971
+ 36,
8972
+ 1,
8973
+ 1,
8974
+ 126,
8975
+ 32,
8976
+ 0,
8977
+ 173,
8978
+ 32,
8979
+ 1,
8980
+ 173,
8981
+ 66,
8982
+ 32,
8983
+ 134,
8984
+ 132,
8985
+ 32,
8986
+ 2,
8987
+ 173,
8988
+ 32,
8989
+ 3,
8990
+ 173,
8991
+ 66,
8992
+ 32,
8993
+ 134,
8994
+ 132,
8995
+ 130,
8996
+ 34,
8997
+ 4,
8998
+ 66,
8999
+ 32,
9000
+ 135,
9001
+ 167,
9002
+ 36,
9003
+ 0,
9004
+ 32,
9005
+ 4,
9006
+ 167,
9007
+ 11
9008
+ ])
9009
+ ),
9010
+ {}
9011
+ ).exports;
9012
+ } catch {
8949
9013
  }
8950
9014
  function Long(low, high, unsigned) {
8951
9015
  this.low = low | 0;
@@ -8970,44 +9034,38 @@ function fromInt(value, unsigned) {
8970
9034
  value >>>= 0;
8971
9035
  if (cache = 0 <= value && value < 256) {
8972
9036
  cachedObj = UINT_CACHE[value];
8973
- if (cachedObj)
8974
- return cachedObj;
9037
+ if (cachedObj) return cachedObj;
8975
9038
  }
8976
9039
  obj = fromBits(value, 0, true);
8977
- if (cache)
8978
- UINT_CACHE[value] = obj;
9040
+ if (cache) UINT_CACHE[value] = obj;
8979
9041
  return obj;
8980
9042
  } else {
8981
9043
  value |= 0;
8982
9044
  if (cache = -128 <= value && value < 128) {
8983
9045
  cachedObj = INT_CACHE[value];
8984
- if (cachedObj)
8985
- return cachedObj;
9046
+ if (cachedObj) return cachedObj;
8986
9047
  }
8987
9048
  obj = fromBits(value, value < 0 ? -1 : 0, false);
8988
- if (cache)
8989
- INT_CACHE[value] = obj;
9049
+ if (cache) INT_CACHE[value] = obj;
8990
9050
  return obj;
8991
9051
  }
8992
9052
  }
8993
9053
  Long.fromInt = fromInt;
8994
9054
  function fromNumber(value, unsigned) {
8995
- if (isNaN(value))
8996
- return unsigned ? UZERO : ZERO;
9055
+ if (isNaN(value)) return unsigned ? UZERO : ZERO;
8997
9056
  if (unsigned) {
8998
- if (value < 0)
8999
- return UZERO;
9000
- if (value >= TWO_PWR_64_DBL)
9001
- return MAX_UNSIGNED_VALUE;
9057
+ if (value < 0) return UZERO;
9058
+ if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE;
9002
9059
  } else {
9003
- if (value <= -TWO_PWR_63_DBL)
9004
- return MIN_VALUE;
9005
- if (value + 1 >= TWO_PWR_63_DBL)
9006
- return MAX_VALUE;
9060
+ if (value <= -9223372036854776e3) return MIN_VALUE;
9061
+ if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE;
9007
9062
  }
9008
- if (value < 0)
9009
- return fromNumber(-value, unsigned).neg();
9010
- return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned);
9063
+ if (value < 0) return fromNumber(-value, unsigned).neg();
9064
+ return fromBits(
9065
+ value % TWO_PWR_32_DBL | 0,
9066
+ value / TWO_PWR_32_DBL | 0,
9067
+ unsigned
9068
+ );
9011
9069
  }
9012
9070
  Long.fromNumber = fromNumber;
9013
9071
  function fromBits(lowBits, highBits, unsigned) {
@@ -9016,8 +9074,7 @@ function fromBits(lowBits, highBits, unsigned) {
9016
9074
  Long.fromBits = fromBits;
9017
9075
  var pow_dbl = Math.pow;
9018
9076
  function fromString(str, unsigned, radix) {
9019
- if (str.length === 0)
9020
- throw Error("empty string");
9077
+ if (str.length === 0) throw Error("empty string");
9021
9078
  if (typeof unsigned === "number") {
9022
9079
  radix = unsigned;
9023
9080
  unsigned = false;
@@ -9027,11 +9084,9 @@ function fromString(str, unsigned, radix) {
9027
9084
  if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
9028
9085
  return unsigned ? UZERO : ZERO;
9029
9086
  radix = radix || 10;
9030
- if (radix < 2 || 36 < radix)
9031
- throw RangeError("radix");
9087
+ if (radix < 2 || 36 < radix) throw RangeError("radix");
9032
9088
  var p;
9033
- if ((p = str.indexOf("-")) > 0)
9034
- throw Error("interior hyphen");
9089
+ if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen");
9035
9090
  else if (p === 0) {
9036
9091
  return fromString(str.substring(1), unsigned, radix).neg();
9037
9092
  }
@@ -9052,11 +9107,13 @@ function fromString(str, unsigned, radix) {
9052
9107
  }
9053
9108
  Long.fromString = fromString;
9054
9109
  function fromValue(val, unsigned) {
9055
- if (typeof val === "number")
9056
- return fromNumber(val, unsigned);
9057
- if (typeof val === "string")
9058
- return fromString(val, unsigned);
9059
- return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned);
9110
+ if (typeof val === "number") return fromNumber(val, unsigned);
9111
+ if (typeof val === "string") return fromString(val, unsigned);
9112
+ return fromBits(
9113
+ val.low,
9114
+ val.high,
9115
+ typeof unsigned === "boolean" ? unsigned : val.unsigned
9116
+ );
9060
9117
  }
9061
9118
  Long.fromValue = fromValue;
9062
9119
  var TWO_PWR_16_DBL = 1 << 16;
@@ -9092,27 +9149,22 @@ LongPrototype.toNumber = function toNumber() {
9092
9149
  };
9093
9150
  LongPrototype.toString = function toString(radix) {
9094
9151
  radix = radix || 10;
9095
- if (radix < 2 || 36 < radix)
9096
- throw RangeError("radix");
9097
- if (this.isZero())
9098
- return "0";
9152
+ if (radix < 2 || 36 < radix) throw RangeError("radix");
9153
+ if (this.isZero()) return "0";
9099
9154
  if (this.isNegative()) {
9100
9155
  if (this.eq(MIN_VALUE)) {
9101
9156
  var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this);
9102
9157
  return div.toString(radix) + rem1.toInt().toString(radix);
9103
- } else
9104
- return "-" + this.neg().toString(radix);
9158
+ } else return "-" + this.neg().toString(radix);
9105
9159
  }
9106
9160
  var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this;
9107
9161
  var result = "";
9108
9162
  while (true) {
9109
9163
  var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix);
9110
9164
  rem = remDiv;
9111
- if (rem.isZero())
9112
- return digits + result;
9165
+ if (rem.isZero()) return digits + result;
9113
9166
  else {
9114
- while (digits.length < 6)
9115
- digits = "0" + digits;
9167
+ while (digits.length < 6) digits = "0" + digits;
9116
9168
  result = "" + digits + result;
9117
9169
  }
9118
9170
  }
@@ -9133,11 +9185,15 @@ LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
9133
9185
  if (this.isNegative())
9134
9186
  return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
9135
9187
  var val = this.high != 0 ? this.high : this.low;
9136
- for (var bit = 31; bit > 0; bit--)
9137
- if ((val & 1 << bit) != 0)
9138
- break;
9188
+ for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break;
9139
9189
  return this.high != 0 ? bit + 33 : bit + 1;
9140
9190
  };
9191
+ LongPrototype.isSafeInteger = function isSafeInteger() {
9192
+ var top11Bits = this.high >> 21;
9193
+ if (!top11Bits) return true;
9194
+ if (this.unsigned) return false;
9195
+ return top11Bits === -1 && !(this.low === 0 && this.high === -2097152);
9196
+ };
9141
9197
  LongPrototype.isZero = function isZero() {
9142
9198
  return this.high === 0 && this.low === 0;
9143
9199
  };
@@ -9155,8 +9211,7 @@ LongPrototype.isEven = function isEven() {
9155
9211
  return (this.low & 1) === 0;
9156
9212
  };
9157
9213
  LongPrototype.equals = function equals(other) {
9158
- if (!isLong(other))
9159
- other = fromValue(other);
9214
+ if (!isLong(other)) other = fromValue(other);
9160
9215
  if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1)
9161
9216
  return false;
9162
9217
  return this.high === other.high && this.low === other.low;
@@ -9201,29 +9256,22 @@ LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
9201
9256
  LongPrototype.gte = LongPrototype.greaterThanOrEqual;
9202
9257
  LongPrototype.ge = LongPrototype.greaterThanOrEqual;
9203
9258
  LongPrototype.compare = function compare(other) {
9204
- if (!isLong(other))
9205
- other = fromValue(other);
9206
- if (this.eq(other))
9207
- return 0;
9259
+ if (!isLong(other)) other = fromValue(other);
9260
+ if (this.eq(other)) return 0;
9208
9261
  var thisNeg = this.isNegative(), otherNeg = other.isNegative();
9209
- if (thisNeg && !otherNeg)
9210
- return -1;
9211
- if (!thisNeg && otherNeg)
9212
- return 1;
9213
- if (!this.unsigned)
9214
- return this.sub(other).isNegative() ? -1 : 1;
9262
+ if (thisNeg && !otherNeg) return -1;
9263
+ if (!thisNeg && otherNeg) return 1;
9264
+ if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1;
9215
9265
  return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1;
9216
9266
  };
9217
9267
  LongPrototype.comp = LongPrototype.compare;
9218
9268
  LongPrototype.negate = function negate2() {
9219
- if (!this.unsigned && this.eq(MIN_VALUE))
9220
- return MIN_VALUE;
9269
+ if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE;
9221
9270
  return this.not().add(ONE);
9222
9271
  };
9223
9272
  LongPrototype.neg = LongPrototype.negate;
9224
9273
  LongPrototype.add = function add(addend) {
9225
- if (!isLong(addend))
9226
- addend = fromValue(addend);
9274
+ if (!isLong(addend)) addend = fromValue(addend);
9227
9275
  var a48 = this.high >>> 16;
9228
9276
  var a32 = this.high & 65535;
9229
9277
  var a16 = this.low >>> 16;
@@ -9247,38 +9295,24 @@ LongPrototype.add = function add(addend) {
9247
9295
  return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned);
9248
9296
  };
9249
9297
  LongPrototype.subtract = function subtract(subtrahend) {
9250
- if (!isLong(subtrahend))
9251
- subtrahend = fromValue(subtrahend);
9298
+ if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend);
9252
9299
  return this.add(subtrahend.neg());
9253
9300
  };
9254
9301
  LongPrototype.sub = LongPrototype.subtract;
9255
9302
  LongPrototype.multiply = function multiply(multiplier) {
9256
- if (this.isZero())
9257
- return this;
9258
- if (!isLong(multiplier))
9259
- multiplier = fromValue(multiplier);
9303
+ if (this.isZero()) return this;
9304
+ if (!isLong(multiplier)) multiplier = fromValue(multiplier);
9260
9305
  if (wasm) {
9261
- var low = wasm["mul"](
9262
- this.low,
9263
- this.high,
9264
- multiplier.low,
9265
- multiplier.high
9266
- );
9306
+ var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high);
9267
9307
  return fromBits(low, wasm["get_high"](), this.unsigned);
9268
9308
  }
9269
- if (multiplier.isZero())
9270
- return this.unsigned ? UZERO : ZERO;
9271
- if (this.eq(MIN_VALUE))
9272
- return multiplier.isOdd() ? MIN_VALUE : ZERO;
9273
- if (multiplier.eq(MIN_VALUE))
9274
- return this.isOdd() ? MIN_VALUE : ZERO;
9309
+ if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO;
9310
+ if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO;
9311
+ if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO;
9275
9312
  if (this.isNegative()) {
9276
- if (multiplier.isNegative())
9277
- return this.neg().mul(multiplier.neg());
9278
- else
9279
- return this.neg().mul(multiplier).neg();
9280
- } else if (multiplier.isNegative())
9281
- return this.mul(multiplier.neg()).neg();
9313
+ if (multiplier.isNegative()) return this.neg().mul(multiplier.neg());
9314
+ else return this.neg().mul(multiplier).neg();
9315
+ } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg();
9282
9316
  if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))
9283
9317
  return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
9284
9318
  var a48 = this.high >>> 16;
@@ -9314,10 +9348,8 @@ LongPrototype.multiply = function multiply(multiplier) {
9314
9348
  };
9315
9349
  LongPrototype.mul = LongPrototype.multiply;
9316
9350
  LongPrototype.divide = function divide(divisor) {
9317
- if (!isLong(divisor))
9318
- divisor = fromValue(divisor);
9319
- if (divisor.isZero())
9320
- throw Error("division by zero");
9351
+ if (!isLong(divisor)) divisor = fromValue(divisor);
9352
+ if (divisor.isZero()) throw Error("division by zero");
9321
9353
  if (wasm) {
9322
9354
  if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) {
9323
9355
  return this;
@@ -9330,15 +9362,13 @@ LongPrototype.divide = function divide(divisor) {
9330
9362
  );
9331
9363
  return fromBits(low, wasm["get_high"](), this.unsigned);
9332
9364
  }
9333
- if (this.isZero())
9334
- return this.unsigned ? UZERO : ZERO;
9365
+ if (this.isZero()) return this.unsigned ? UZERO : ZERO;
9335
9366
  var approx, rem, res;
9336
9367
  if (!this.unsigned) {
9337
9368
  if (this.eq(MIN_VALUE)) {
9338
9369
  if (divisor.eq(ONE) || divisor.eq(NEG_ONE))
9339
9370
  return MIN_VALUE;
9340
- else if (divisor.eq(MIN_VALUE))
9341
- return ONE;
9371
+ else if (divisor.eq(MIN_VALUE)) return ONE;
9342
9372
  else {
9343
9373
  var halfThis = this.shr(1);
9344
9374
  approx = halfThis.div(divisor).shl(1);
@@ -9350,20 +9380,15 @@ LongPrototype.divide = function divide(divisor) {
9350
9380
  return res;
9351
9381
  }
9352
9382
  }
9353
- } else if (divisor.eq(MIN_VALUE))
9354
- return this.unsigned ? UZERO : ZERO;
9383
+ } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO;
9355
9384
  if (this.isNegative()) {
9356
- if (divisor.isNegative())
9357
- return this.neg().div(divisor.neg());
9385
+ if (divisor.isNegative()) return this.neg().div(divisor.neg());
9358
9386
  return this.neg().div(divisor).neg();
9359
- } else if (divisor.isNegative())
9360
- return this.div(divisor.neg()).neg();
9387
+ } else if (divisor.isNegative()) return this.div(divisor.neg()).neg();
9361
9388
  res = ZERO;
9362
9389
  } else {
9363
- if (!divisor.unsigned)
9364
- divisor = divisor.toUnsigned();
9365
- if (divisor.gt(this))
9366
- return UZERO;
9390
+ if (!divisor.unsigned) divisor = divisor.toUnsigned();
9391
+ if (divisor.gt(this)) return UZERO;
9367
9392
  if (divisor.gt(this.shru(1)))
9368
9393
  return UONE;
9369
9394
  res = UZERO;
@@ -9377,8 +9402,7 @@ LongPrototype.divide = function divide(divisor) {
9377
9402
  approxRes = fromNumber(approx, this.unsigned);
9378
9403
  approxRem = approxRes.mul(divisor);
9379
9404
  }
9380
- if (approxRes.isZero())
9381
- approxRes = ONE;
9405
+ if (approxRes.isZero()) approxRes = ONE;
9382
9406
  res = res.add(approxRes);
9383
9407
  rem = rem.sub(approxRem);
9384
9408
  }
@@ -9386,8 +9410,7 @@ LongPrototype.divide = function divide(divisor) {
9386
9410
  };
9387
9411
  LongPrototype.div = LongPrototype.divide;
9388
9412
  LongPrototype.modulo = function modulo(divisor) {
9389
- if (!isLong(divisor))
9390
- divisor = fromValue(divisor);
9413
+ if (!isLong(divisor)) divisor = fromValue(divisor);
9391
9414
  if (wasm) {
9392
9415
  var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(
9393
9416
  this.low,
@@ -9413,46 +9436,55 @@ LongPrototype.countTrailingZeros = function countTrailingZeros() {
9413
9436
  };
9414
9437
  LongPrototype.ctz = LongPrototype.countTrailingZeros;
9415
9438
  LongPrototype.and = function and(other) {
9416
- if (!isLong(other))
9417
- other = fromValue(other);
9439
+ if (!isLong(other)) other = fromValue(other);
9418
9440
  return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
9419
9441
  };
9420
9442
  LongPrototype.or = function or(other) {
9421
- if (!isLong(other))
9422
- other = fromValue(other);
9443
+ if (!isLong(other)) other = fromValue(other);
9423
9444
  return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
9424
9445
  };
9425
9446
  LongPrototype.xor = function xor(other) {
9426
- if (!isLong(other))
9427
- other = fromValue(other);
9447
+ if (!isLong(other)) other = fromValue(other);
9428
9448
  return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
9429
9449
  };
9430
9450
  LongPrototype.shiftLeft = function shiftLeft(numBits) {
9431
- if (isLong(numBits))
9432
- numBits = numBits.toInt();
9433
- if ((numBits &= 63) === 0)
9434
- return this;
9451
+ if (isLong(numBits)) numBits = numBits.toInt();
9452
+ if ((numBits &= 63) === 0) return this;
9435
9453
  else if (numBits < 32)
9436
- return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned);
9437
- else
9438
- return fromBits(0, this.low << numBits - 32, this.unsigned);
9454
+ return fromBits(
9455
+ this.low << numBits,
9456
+ this.high << numBits | this.low >>> 32 - numBits,
9457
+ this.unsigned
9458
+ );
9459
+ else return fromBits(0, this.low << numBits - 32, this.unsigned);
9439
9460
  };
9440
9461
  LongPrototype.shl = LongPrototype.shiftLeft;
9441
9462
  LongPrototype.shiftRight = function shiftRight(numBits) {
9442
- if (isLong(numBits))
9443
- numBits = numBits.toInt();
9444
- if ((numBits &= 63) === 0)
9445
- return this;
9463
+ if (isLong(numBits)) numBits = numBits.toInt();
9464
+ if ((numBits &= 63) === 0) return this;
9446
9465
  else if (numBits < 32)
9447
- return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned);
9466
+ return fromBits(
9467
+ this.low >>> numBits | this.high << 32 - numBits,
9468
+ this.high >> numBits,
9469
+ this.unsigned
9470
+ );
9448
9471
  else
9449
- return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned);
9472
+ return fromBits(
9473
+ this.high >> numBits - 32,
9474
+ this.high >= 0 ? 0 : -1,
9475
+ this.unsigned
9476
+ );
9450
9477
  };
9451
9478
  LongPrototype.shr = LongPrototype.shiftRight;
9452
9479
  LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
9453
9480
  if (isLong(numBits)) numBits = numBits.toInt();
9454
9481
  if ((numBits &= 63) === 0) return this;
9455
- if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned);
9482
+ if (numBits < 32)
9483
+ return fromBits(
9484
+ this.low >>> numBits | this.high << 32 - numBits,
9485
+ this.high >>> numBits,
9486
+ this.unsigned
9487
+ );
9456
9488
  if (numBits === 32) return fromBits(this.high, 0, this.unsigned);
9457
9489
  return fromBits(this.high >>> numBits - 32, 0, this.unsigned);
9458
9490
  };
@@ -9465,11 +9497,19 @@ LongPrototype.rotateLeft = function rotateLeft(numBits) {
9465
9497
  if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);
9466
9498
  if (numBits < 32) {
9467
9499
  b = 32 - numBits;
9468
- return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned);
9500
+ return fromBits(
9501
+ this.low << numBits | this.high >>> b,
9502
+ this.high << numBits | this.low >>> b,
9503
+ this.unsigned
9504
+ );
9469
9505
  }
9470
9506
  numBits -= 32;
9471
9507
  b = 32 - numBits;
9472
- return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned);
9508
+ return fromBits(
9509
+ this.high << numBits | this.low >>> b,
9510
+ this.low << numBits | this.high >>> b,
9511
+ this.unsigned
9512
+ );
9473
9513
  };
9474
9514
  LongPrototype.rotl = LongPrototype.rotateLeft;
9475
9515
  LongPrototype.rotateRight = function rotateRight(numBits) {
@@ -9479,21 +9519,27 @@ LongPrototype.rotateRight = function rotateRight(numBits) {
9479
9519
  if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);
9480
9520
  if (numBits < 32) {
9481
9521
  b = 32 - numBits;
9482
- return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned);
9522
+ return fromBits(
9523
+ this.high << b | this.low >>> numBits,
9524
+ this.low << b | this.high >>> numBits,
9525
+ this.unsigned
9526
+ );
9483
9527
  }
9484
9528
  numBits -= 32;
9485
9529
  b = 32 - numBits;
9486
- return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned);
9530
+ return fromBits(
9531
+ this.low << b | this.high >>> numBits,
9532
+ this.high << b | this.low >>> numBits,
9533
+ this.unsigned
9534
+ );
9487
9535
  };
9488
9536
  LongPrototype.rotr = LongPrototype.rotateRight;
9489
9537
  LongPrototype.toSigned = function toSigned() {
9490
- if (!this.unsigned)
9491
- return this;
9538
+ if (!this.unsigned) return this;
9492
9539
  return fromBits(this.low, this.high, false);
9493
9540
  };
9494
9541
  LongPrototype.toUnsigned = function toUnsigned2() {
9495
- if (this.unsigned)
9496
- return this;
9542
+ if (this.unsigned) return this;
9497
9543
  return fromBits(this.low, this.high, true);
9498
9544
  };
9499
9545
  LongPrototype.toBytes = function toBytes(le) {
@@ -9542,6 +9588,22 @@ Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
9542
9588
  unsigned
9543
9589
  );
9544
9590
  };
9591
+ if (typeof BigInt === "function") {
9592
+ Long.fromBigInt = function fromBigInt2(value, unsigned) {
9593
+ var lowBits = Number(BigInt.asIntN(32, value));
9594
+ var highBits = Number(BigInt.asIntN(32, value >> BigInt(32)));
9595
+ return fromBits(lowBits, highBits, unsigned);
9596
+ };
9597
+ Long.fromValue = function fromValueWithBigInt(value, unsigned) {
9598
+ if (typeof value === "bigint") return fromBigInt(value, unsigned);
9599
+ return fromValue(value, unsigned);
9600
+ };
9601
+ LongPrototype.toBigInt = function toBigInt() {
9602
+ var lowBigInt = BigInt(this.low >>> 0);
9603
+ var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high);
9604
+ return highBigInt << BigInt(32) | lowBigInt;
9605
+ };
9606
+ }
9545
9607
  var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
9546
9608
  PrimitiveType2[PrimitiveType2["Null"] = 0] = "Null";
9547
9609
  PrimitiveType2[PrimitiveType2["Boolean"] = 1] = "Boolean";
@@ -20153,96 +20215,10 @@ function createAuthInterceptor(apiKey, token) {
20153
20215
  };
20154
20216
  }
20155
20217
  const name = "@yorkie-js/sdk";
20156
- const version = "0.6.5";
20157
- const description = "Yorkie JS SDK";
20158
- const main = "./src/yorkie.ts";
20159
- const publishConfig = {
20160
- access: "public",
20161
- main: "./dist/yorkie-js-sdk.js",
20162
- typings: "./dist/yorkie-js-sdk.d.ts"
20163
- };
20164
- const files = [
20165
- "dist",
20166
- "README.md"
20167
- ];
20168
- const scripts = {
20169
- build: "tsc && vite build",
20170
- "build:proto": "npx buf generate",
20171
- "build:docs": "typedoc",
20172
- "build:ghpages": "mkdir -p ghpages/examples && cp -r docs ghpages/api-reference && find ../../examples -name 'dist' -type d -exec sh -c 'cp -r {} ghpages/examples/$(basename $(dirname {}))' \\;",
20173
- dev: "vite build -c vite.preview.ts && vite preview",
20174
- test: "vitest run",
20175
- "test:watch": "vitest",
20176
- "test:bench": "vitest bench",
20177
- "test:ci": "vitest run --coverage",
20178
- "test:yorkie.dev": "TEST_RPC_ADDR=https://api.yorkie.dev vitest run --coverage",
20179
- prepare: "pnpm build"
20180
- };
20181
- const engines = {
20182
- node: ">=18.0.0",
20183
- npm: ">=7.1.0"
20184
- };
20185
- const repository = {
20186
- type: "git",
20187
- url: "git+https://github.com/yorkie-team/yorkie-js-sdk.git"
20188
- };
20189
- const author = {
20190
- name: "hackerwins",
20191
- email: "susukang98@gmail.com"
20192
- };
20193
- const license = "Apache-2.0";
20194
- const bugs = {
20195
- url: "https://github.com/yorkie-team/yorkie-js-sdk/issues"
20196
- };
20197
- const homepage = "https://github.com/yorkie-team/yorkie-js-sdk#readme";
20198
- const devDependencies = {
20199
- "@buf/googleapis_googleapis.bufbuild_es": "^1.4.0-20240524201209-f0e53af8f2fc.3",
20200
- "@bufbuild/buf": "^1.28.1",
20201
- "@bufbuild/protoc-gen-es": "^1.6.0",
20202
- "@connectrpc/protoc-gen-connect-es": "^1.4.0",
20203
- "@types/express": "^4.17.21",
20204
- "@types/google-protobuf": "^3.15.5",
20205
- "@types/long": "^4.0.1",
20206
- "@typescript-eslint/eslint-plugin": "^6.21.0",
20207
- "@typescript-eslint/parser": "^6.21.0",
20208
- "@vitest/coverage-istanbul": "^0.34.5",
20209
- "@vitest/coverage-v8": "^0.34.5",
20210
- axios: "^1.7.7",
20211
- "eslint-plugin-tsdoc": "^0.2.16",
20212
- express: "^4.21.1",
20213
- prettier: "^2.7.1",
20214
- "ts-node": "^10.9.1",
20215
- typedoc: "^0.25.13",
20216
- typescript: "^5.3.3",
20217
- "typescript-transform-paths": "^3.3.1",
20218
- vite: "^5.0.12",
20219
- "vite-plugin-commonjs": "^0.10.1",
20220
- "vite-plugin-dts": "^3.9.1",
20221
- "vite-tsconfig-paths": "^4.3.1",
20222
- vitest: "^0.34.5"
20223
- };
20224
- const dependencies = {
20225
- "@bufbuild/protobuf": "^1.6.0",
20226
- "@connectrpc/connect": "^1.4.0",
20227
- "@connectrpc/connect-web": "^1.4.0",
20228
- long: "^5.2.0"
20229
- };
20218
+ const version = "0.6.6";
20230
20219
  const pkg = {
20231
20220
  name,
20232
- version,
20233
- description,
20234
- main,
20235
- publishConfig,
20236
- files,
20237
- scripts,
20238
- engines,
20239
- repository,
20240
- author,
20241
- license,
20242
- bugs,
20243
- homepage,
20244
- devDependencies,
20245
- dependencies
20221
+ version
20246
20222
  };
20247
20223
  function createMetricInterceptor() {
20248
20224
  return (next) => async (req) => {