@milaboratories/pl-client 2.11.8 → 2.11.9

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.
Files changed (242) hide show
  1. package/dist/core/auth.cjs +24 -0
  2. package/dist/core/auth.cjs.map +1 -0
  3. package/dist/core/auth.d.ts +0 -1
  4. package/dist/core/auth.js +21 -0
  5. package/dist/core/auth.js.map +1 -0
  6. package/dist/core/cache.d.ts +0 -1
  7. package/dist/core/client.cjs +288 -0
  8. package/dist/core/client.cjs.map +1 -0
  9. package/dist/core/client.d.ts +0 -1
  10. package/dist/core/client.js +267 -0
  11. package/dist/core/client.js.map +1 -0
  12. package/dist/core/config.cjs +111 -0
  13. package/dist/core/config.cjs.map +1 -0
  14. package/dist/core/config.d.ts +0 -1
  15. package/dist/core/config.js +95 -0
  16. package/dist/core/config.js.map +1 -0
  17. package/dist/core/default_client.cjs +143 -0
  18. package/dist/core/default_client.cjs.map +1 -0
  19. package/dist/core/default_client.d.ts +0 -1
  20. package/dist/core/default_client.js +120 -0
  21. package/dist/core/default_client.js.map +1 -0
  22. package/dist/core/driver.cjs +14 -0
  23. package/dist/core/driver.cjs.map +1 -0
  24. package/dist/core/driver.d.ts +0 -1
  25. package/dist/core/driver.js +12 -0
  26. package/dist/core/driver.js.map +1 -0
  27. package/dist/core/error_resource.cjs +9 -0
  28. package/dist/core/error_resource.cjs.map +1 -0
  29. package/dist/core/error_resource.d.ts +0 -1
  30. package/dist/core/error_resource.js +7 -0
  31. package/dist/core/error_resource.js.map +1 -0
  32. package/dist/core/errors.cjs +106 -0
  33. package/dist/core/errors.cjs.map +1 -0
  34. package/dist/core/errors.d.ts +0 -1
  35. package/dist/core/errors.js +93 -0
  36. package/dist/core/errors.js.map +1 -0
  37. package/dist/core/final.cjs +98 -0
  38. package/dist/core/final.cjs.map +1 -0
  39. package/dist/core/final.d.ts +0 -1
  40. package/dist/core/final.js +96 -0
  41. package/dist/core/final.js.map +1 -0
  42. package/dist/core/grpc.d.ts +0 -1
  43. package/dist/core/http.d.ts +1 -1
  44. package/dist/core/ll_client.cjs +266 -0
  45. package/dist/core/ll_client.cjs.map +1 -0
  46. package/dist/core/ll_client.d.ts +0 -1
  47. package/dist/core/ll_client.js +264 -0
  48. package/dist/core/ll_client.js.map +1 -0
  49. package/dist/core/ll_transaction.cjs +236 -0
  50. package/dist/core/ll_transaction.cjs.map +1 -0
  51. package/dist/core/ll_transaction.d.ts +0 -1
  52. package/dist/core/ll_transaction.js +233 -0
  53. package/dist/core/ll_transaction.js.map +1 -0
  54. package/dist/core/stat.cjs +74 -0
  55. package/dist/core/stat.cjs.map +1 -0
  56. package/dist/core/stat.d.ts +0 -1
  57. package/dist/core/stat.js +70 -0
  58. package/dist/core/stat.js.map +1 -0
  59. package/dist/core/transaction.cjs +626 -0
  60. package/dist/core/transaction.cjs.map +1 -0
  61. package/dist/core/transaction.d.ts +0 -1
  62. package/dist/core/transaction.js +613 -0
  63. package/dist/core/transaction.js.map +1 -0
  64. package/dist/core/type_conversion.cjs +106 -0
  65. package/dist/core/type_conversion.cjs.map +1 -0
  66. package/dist/core/type_conversion.d.ts +0 -1
  67. package/dist/core/type_conversion.js +102 -0
  68. package/dist/core/type_conversion.js.map +1 -0
  69. package/dist/core/types.cjs +159 -0
  70. package/dist/core/types.cjs.map +1 -0
  71. package/dist/core/types.d.ts +0 -1
  72. package/dist/core/types.js +134 -0
  73. package/dist/core/types.js.map +1 -0
  74. package/dist/core/unauth_client.cjs +43 -0
  75. package/dist/core/unauth_client.cjs.map +1 -0
  76. package/dist/core/unauth_client.d.ts +0 -1
  77. package/dist/core/unauth_client.js +41 -0
  78. package/dist/core/unauth_client.js.map +1 -0
  79. package/dist/helpers/pl.cjs +124 -0
  80. package/dist/helpers/pl.cjs.map +1 -0
  81. package/dist/helpers/pl.d.ts +0 -1
  82. package/dist/helpers/pl.js +94 -0
  83. package/dist/helpers/pl.js.map +1 -0
  84. package/dist/helpers/poll.cjs +148 -0
  85. package/dist/helpers/poll.cjs.map +1 -0
  86. package/dist/helpers/poll.d.ts +0 -1
  87. package/dist/helpers/poll.js +123 -0
  88. package/dist/helpers/poll.js.map +1 -0
  89. package/dist/helpers/rich_resource_types.d.ts +1 -1
  90. package/dist/helpers/smart_accessors.d.ts +1 -1
  91. package/dist/helpers/state_helpers.d.ts +0 -1
  92. package/dist/helpers/tx_helpers.cjs +25 -0
  93. package/dist/helpers/tx_helpers.cjs.map +1 -0
  94. package/dist/helpers/tx_helpers.d.ts +0 -1
  95. package/dist/helpers/tx_helpers.js +23 -0
  96. package/dist/helpers/tx_helpers.js.map +1 -0
  97. package/dist/index.cjs +99 -0
  98. package/dist/index.cjs.map +1 -0
  99. package/dist/index.d.ts +0 -1
  100. package/dist/index.js +16 -1
  101. package/dist/index.js.map +1 -1
  102. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.cjs +71 -0
  103. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.cjs.map +1 -0
  104. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts +0 -1
  105. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.js +69 -0
  106. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.js.map +1 -0
  107. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +3 -5
  108. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +0 -1
  109. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +3 -5
  110. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +0 -1
  111. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +3 -5
  112. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +0 -1
  113. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +3 -5
  114. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +0 -1
  115. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +12238 -0
  116. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.cjs.map +1 -0
  117. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs +223 -0
  118. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs.map +1 -0
  119. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +3 -5
  120. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.js +221 -0
  121. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.js.map +1 -0
  122. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +0 -1
  123. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.js +12086 -0
  124. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.js.map +1 -0
  125. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs +1127 -0
  126. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs.map +1 -0
  127. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +0 -1
  128. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.js +1113 -0
  129. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.js.map +1 -0
  130. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs +152 -0
  131. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs.map +1 -0
  132. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +0 -1
  133. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.js +149 -0
  134. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.js.map +1 -0
  135. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts +0 -1
  136. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs +500 -0
  137. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs.map +1 -0
  138. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +0 -1
  139. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js +496 -0
  140. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js.map +1 -0
  141. package/dist/proto/google/api/http.d.ts +0 -1
  142. package/dist/proto/google/protobuf/any.cjs +151 -0
  143. package/dist/proto/google/protobuf/any.cjs.map +1 -0
  144. package/dist/proto/google/protobuf/any.d.ts +0 -1
  145. package/dist/proto/google/protobuf/any.js +149 -0
  146. package/dist/proto/google/protobuf/any.js.map +1 -0
  147. package/dist/proto/google/protobuf/descriptor.d.ts +0 -1
  148. package/dist/proto/google/protobuf/duration.cjs +105 -0
  149. package/dist/proto/google/protobuf/duration.cjs.map +1 -0
  150. package/dist/proto/google/protobuf/duration.d.ts +0 -1
  151. package/dist/proto/google/protobuf/duration.js +103 -0
  152. package/dist/proto/google/protobuf/duration.js.map +1 -0
  153. package/dist/proto/google/protobuf/empty.d.ts +0 -1
  154. package/dist/proto/google/protobuf/struct.d.ts +0 -1
  155. package/dist/proto/google/protobuf/timestamp.cjs +133 -0
  156. package/dist/proto/google/protobuf/timestamp.cjs.map +1 -0
  157. package/dist/proto/google/protobuf/timestamp.d.ts +0 -1
  158. package/dist/proto/google/protobuf/timestamp.js +131 -0
  159. package/dist/proto/google/protobuf/timestamp.js.map +1 -0
  160. package/dist/proto/google/protobuf/wrappers.d.ts +0 -1
  161. package/dist/test/test_config.cjs +149 -0
  162. package/dist/test/test_config.cjs.map +1 -0
  163. package/dist/test/test_config.d.ts +0 -1
  164. package/dist/test/test_config.js +123 -0
  165. package/dist/test/test_config.js.map +1 -0
  166. package/dist/util/branding.d.ts +0 -1
  167. package/dist/util/pl.cjs +8 -0
  168. package/dist/util/pl.cjs.map +1 -0
  169. package/dist/util/pl.d.ts +0 -1
  170. package/dist/util/pl.js +6 -0
  171. package/dist/util/pl.js.map +1 -0
  172. package/dist/util/util.cjs +17 -0
  173. package/dist/util/util.cjs.map +1 -0
  174. package/dist/util/util.d.ts +0 -1
  175. package/dist/util/util.js +15 -0
  176. package/dist/util/util.js.map +1 -0
  177. package/package.json +14 -11
  178. package/src/core/client.test.ts +1 -0
  179. package/src/core/config.test.ts +1 -0
  180. package/src/core/error.test.ts +1 -0
  181. package/src/core/ll_client.test.ts +1 -0
  182. package/src/core/ll_transaction.test.ts +1 -0
  183. package/src/core/transaction.test.ts +1 -0
  184. package/src/core/types.test.ts +1 -0
  185. package/src/core/unauth_client.test.ts +1 -0
  186. package/src/helpers/rich_resource_types.test.ts +2 -0
  187. package/src/test/test_config.test.ts +1 -0
  188. package/src/util/util.test.ts +1 -0
  189. package/dist/core/auth.d.ts.map +0 -1
  190. package/dist/core/cache.d.ts.map +0 -1
  191. package/dist/core/client.d.ts.map +0 -1
  192. package/dist/core/config.d.ts.map +0 -1
  193. package/dist/core/default_client.d.ts.map +0 -1
  194. package/dist/core/driver.d.ts.map +0 -1
  195. package/dist/core/error_resource.d.ts.map +0 -1
  196. package/dist/core/errors.d.ts.map +0 -1
  197. package/dist/core/final.d.ts.map +0 -1
  198. package/dist/core/grpc.d.ts.map +0 -1
  199. package/dist/core/http.d.ts.map +0 -1
  200. package/dist/core/ll_client.d.ts.map +0 -1
  201. package/dist/core/ll_transaction.d.ts.map +0 -1
  202. package/dist/core/stat.d.ts.map +0 -1
  203. package/dist/core/transaction.d.ts.map +0 -1
  204. package/dist/core/type_conversion.d.ts.map +0 -1
  205. package/dist/core/types.d.ts.map +0 -1
  206. package/dist/core/unauth_client.d.ts.map +0 -1
  207. package/dist/helpers/pl.d.ts.map +0 -1
  208. package/dist/helpers/poll.d.ts.map +0 -1
  209. package/dist/helpers/rich_resource_types.d.ts.map +0 -1
  210. package/dist/helpers/smart_accessors.d.ts.map +0 -1
  211. package/dist/helpers/state_helpers.d.ts.map +0 -1
  212. package/dist/helpers/tx_helpers.d.ts.map +0 -1
  213. package/dist/index.d.ts.map +0 -1
  214. package/dist/index.mjs +0 -14537
  215. package/dist/index.mjs.map +0 -1
  216. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +0 -1
  217. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +0 -1
  218. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +0 -1
  219. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +0 -1
  220. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +0 -1
  221. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +0 -1
  222. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +0 -1
  223. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +0 -1
  224. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +0 -1
  225. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +0 -1
  226. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +0 -1
  227. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +0 -1
  228. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +0 -1
  229. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts.map +0 -1
  230. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +0 -1
  231. package/dist/proto/google/api/http.d.ts.map +0 -1
  232. package/dist/proto/google/protobuf/any.d.ts.map +0 -1
  233. package/dist/proto/google/protobuf/descriptor.d.ts.map +0 -1
  234. package/dist/proto/google/protobuf/duration.d.ts.map +0 -1
  235. package/dist/proto/google/protobuf/empty.d.ts.map +0 -1
  236. package/dist/proto/google/protobuf/struct.d.ts.map +0 -1
  237. package/dist/proto/google/protobuf/timestamp.d.ts.map +0 -1
  238. package/dist/proto/google/protobuf/wrappers.d.ts.map +0 -1
  239. package/dist/test/test_config.d.ts.map +0 -1
  240. package/dist/util/branding.d.ts.map +0 -1
  241. package/dist/util/pl.d.ts.map +0 -1
  242. package/dist/util/util.d.ts.map +0 -1
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ var runtime = require('@protobuf-ts/runtime');
4
+
5
+ // @generated message type with reflection information, may provide speed optimized methods
6
+ class Duration$Type extends runtime.MessageType {
7
+ constructor() {
8
+ super("google.protobuf.Duration", [
9
+ { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
10
+ { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
11
+ ]);
12
+ }
13
+ /**
14
+ * Encode `Duration` to JSON string like "3.000001s".
15
+ */
16
+ internalJsonWrite(message, options) {
17
+ let s = runtime.PbLong.from(message.seconds).toNumber();
18
+ if (s > 315576000000 || s < -315576e6)
19
+ throw new Error("Duration value out of range.");
20
+ let text = message.seconds.toString();
21
+ if (s === 0 && message.nanos < 0)
22
+ text = "-" + text;
23
+ if (message.nanos !== 0) {
24
+ let nanosStr = Math.abs(message.nanos).toString();
25
+ nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr;
26
+ if (nanosStr.substring(3) === "000000")
27
+ nanosStr = nanosStr.substring(0, 3);
28
+ else if (nanosStr.substring(6) === "000")
29
+ nanosStr = nanosStr.substring(0, 6);
30
+ text += "." + nanosStr;
31
+ }
32
+ return text + "s";
33
+ }
34
+ /**
35
+ * Decode `Duration` from JSON string like "3.000001s"
36
+ */
37
+ internalJsonRead(json, options, target) {
38
+ if (typeof json !== "string")
39
+ throw new Error("Unable to parse Duration from JSON " + runtime.typeofJsonValue(json) + ". Expected string.");
40
+ let match = json.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);
41
+ if (match === null)
42
+ throw new Error("Unable to parse Duration from JSON string. Invalid format.");
43
+ if (!target)
44
+ target = this.create();
45
+ let [, sign, secs, nanos] = match;
46
+ let longSeconds = runtime.PbLong.from(sign + secs);
47
+ if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576e6)
48
+ throw new Error("Unable to parse Duration from JSON string. Value out of range.");
49
+ target.seconds = longSeconds.toBigInt();
50
+ if (typeof nanos == "string") {
51
+ let nanosStr = sign + nanos + "0".repeat(9 - nanos.length);
52
+ target.nanos = parseInt(nanosStr);
53
+ }
54
+ return target;
55
+ }
56
+ create(value) {
57
+ const message = globalThis.Object.create((this.messagePrototype));
58
+ message.seconds = 0n;
59
+ message.nanos = 0;
60
+ if (value !== undefined)
61
+ runtime.reflectionMergePartial(this, message, value);
62
+ return message;
63
+ }
64
+ internalBinaryRead(reader, length, options, target) {
65
+ let message = target ?? this.create(), end = reader.pos + length;
66
+ while (reader.pos < end) {
67
+ let [fieldNo, wireType] = reader.tag();
68
+ switch (fieldNo) {
69
+ case /* int64 seconds */ 1:
70
+ message.seconds = reader.int64().toBigInt();
71
+ break;
72
+ case /* int32 nanos */ 2:
73
+ message.nanos = reader.int32();
74
+ break;
75
+ default:
76
+ let u = options.readUnknownField;
77
+ if (u === "throw")
78
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
79
+ let d = reader.skip(wireType);
80
+ if (u !== false)
81
+ (u === true ? runtime.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
82
+ }
83
+ }
84
+ return message;
85
+ }
86
+ internalBinaryWrite(message, writer, options) {
87
+ /* int64 seconds = 1; */
88
+ if (message.seconds !== 0n)
89
+ writer.tag(1, runtime.WireType.Varint).int64(message.seconds);
90
+ /* int32 nanos = 2; */
91
+ if (message.nanos !== 0)
92
+ writer.tag(2, runtime.WireType.Varint).int32(message.nanos);
93
+ let u = options.writeUnknownFields;
94
+ if (u !== false)
95
+ (u == true ? runtime.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
96
+ return writer;
97
+ }
98
+ }
99
+ /**
100
+ * @generated MessageType for protobuf message google.protobuf.Duration
101
+ */
102
+ const Duration = new Duration$Type();
103
+
104
+ exports.Duration = Duration;
105
+ //# sourceMappingURL=duration.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.cjs","sources":["../../../../src/proto/google/protobuf/duration.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.0 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"google/protobuf/duration.proto\" (package \"google.protobuf\", syntax proto3)\n// tslint:disable\n//\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc. All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { typeofJsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonReadOptions } from \"@protobuf-ts/runtime\";\nimport type { JsonWriteOptions } from \"@protobuf-ts/runtime\";\nimport { PbLong } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * A Duration represents a signed, fixed-length span of time represented\n * as a count of seconds and fractions of seconds at nanosecond\n * resolution. It is independent of any calendar and concepts like \"day\"\n * or \"month\". It is related to Timestamp in that the difference between\n * two Timestamp values is a Duration and it can be added or subtracted\n * from a Timestamp. Range is approximately +-10,000 years.\n *\n * # Examples\n *\n * Example 1: Compute Duration from two Timestamps in pseudo code.\n *\n * Timestamp start = ...;\n * Timestamp end = ...;\n * Duration duration = ...;\n *\n * duration.seconds = end.seconds - start.seconds;\n * duration.nanos = end.nanos - start.nanos;\n *\n * if (duration.seconds < 0 && duration.nanos > 0) {\n * duration.seconds += 1;\n * duration.nanos -= 1000000000;\n * } else if (duration.seconds > 0 && duration.nanos < 0) {\n * duration.seconds -= 1;\n * duration.nanos += 1000000000;\n * }\n *\n * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.\n *\n * Timestamp start = ...;\n * Duration duration = ...;\n * Timestamp end = ...;\n *\n * end.seconds = start.seconds + duration.seconds;\n * end.nanos = start.nanos + duration.nanos;\n *\n * if (end.nanos < 0) {\n * end.seconds -= 1;\n * end.nanos += 1000000000;\n * } else if (end.nanos >= 1000000000) {\n * end.seconds += 1;\n * end.nanos -= 1000000000;\n * }\n *\n * Example 3: Compute Duration from datetime.timedelta in Python.\n *\n * td = datetime.timedelta(days=3, minutes=10)\n * duration = Duration()\n * duration.FromTimedelta(td)\n *\n * # JSON Mapping\n *\n * In JSON format, the Duration type is encoded as a string rather than an\n * object, where the string ends in the suffix \"s\" (indicating seconds) and\n * is preceded by the number of seconds, with nanoseconds expressed as\n * fractional seconds. For example, 3 seconds with 0 nanoseconds should be\n * encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should\n * be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1\n * microsecond should be expressed in JSON format as \"3.000001s\".\n *\n *\n * @generated from protobuf message google.protobuf.Duration\n */\nexport interface Duration {\n /**\n * Signed seconds of the span of time. Must be from -315,576,000,000\n * to +315,576,000,000 inclusive. Note: these bounds are computed from:\n * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years\n *\n * @generated from protobuf field: int64 seconds = 1\n */\n seconds: bigint;\n /**\n * Signed fractions of a second at nanosecond resolution of the span\n * of time. Durations less than one second are represented with a 0\n * `seconds` field and a positive or negative `nanos` field. For durations\n * of one second or more, a non-zero value for the `nanos` field must be\n * of the same sign as the `seconds` field. Must be from -999,999,999\n * to +999,999,999 inclusive.\n *\n * @generated from protobuf field: int32 nanos = 2\n */\n nanos: number;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Duration$Type extends MessageType<Duration> {\n constructor() {\n super(\"google.protobuf.Duration\", [\n { no: 1, name: \"seconds\", kind: \"scalar\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 2, name: \"nanos\", kind: \"scalar\", T: 5 /*ScalarType.INT32*/ }\n ]);\n }\n /**\n * Encode `Duration` to JSON string like \"3.000001s\".\n */\n internalJsonWrite(message: Duration, options: JsonWriteOptions): JsonValue {\n let s = PbLong.from(message.seconds).toNumber();\n if (s > 315576000000 || s < -315576000000)\n throw new Error(\"Duration value out of range.\");\n let text = message.seconds.toString();\n if (s === 0 && message.nanos < 0)\n text = \"-\" + text;\n if (message.nanos !== 0) {\n let nanosStr = Math.abs(message.nanos).toString();\n nanosStr = \"0\".repeat(9 - nanosStr.length) + nanosStr;\n if (nanosStr.substring(3) === \"000000\")\n nanosStr = nanosStr.substring(0, 3);\n else if (nanosStr.substring(6) === \"000\")\n nanosStr = nanosStr.substring(0, 6);\n text += \".\" + nanosStr;\n }\n return text + \"s\";\n }\n /**\n * Decode `Duration` from JSON string like \"3.000001s\"\n */\n internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Duration): Duration {\n if (typeof json !== \"string\")\n throw new Error(\"Unable to parse Duration from JSON \" + typeofJsonValue(json) + \". Expected string.\");\n let match = json.match(/^(-?)([0-9]+)(?:\\.([0-9]+))?s/);\n if (match === null)\n throw new Error(\"Unable to parse Duration from JSON string. Invalid format.\");\n if (!target)\n target = this.create();\n let [, sign, secs, nanos] = match;\n let longSeconds = PbLong.from(sign + secs);\n if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576000000)\n throw new Error(\"Unable to parse Duration from JSON string. Value out of range.\");\n target.seconds = longSeconds.toBigInt();\n if (typeof nanos == \"string\") {\n let nanosStr = sign + nanos + \"0\".repeat(9 - nanos.length);\n target.nanos = parseInt(nanosStr);\n }\n return target;\n }\n create(value?: PartialMessage<Duration>): Duration {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.seconds = 0n;\n message.nanos = 0;\n if (value !== undefined)\n reflectionMergePartial<Duration>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int64 seconds */ 1:\n message.seconds = reader.int64().toBigInt();\n break;\n case /* int32 nanos */ 2:\n message.nanos = reader.int32();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int64 seconds = 1; */\n if (message.seconds !== 0n)\n writer.tag(1, WireType.Varint).int64(message.seconds);\n /* int32 nanos = 2; */\n if (message.nanos !== 0)\n writer.tag(2, WireType.Varint).int32(message.nanos);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.protobuf.Duration\n */\nexport const Duration = new Duration$Type();\n"],"names":["MessageType","PbLong","typeofJsonValue","reflectionMergePartial","UnknownFieldHandler","WireType"],"mappings":";;;;AAoIA;AACA,MAAM,aAAc,SAAQA,mBAAqB,CAAA;AAC7C,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,0BAA0B,EAAE;YAC9B,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,uBAAuB,CAAC,EAAE,CAAC,sBAAsB;AAC/F,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,C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AAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;;AAEzD,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC;AACnB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEA,gBAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB;QAClC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,GAAGD,2BAAmB,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;AACjF,QAAA,OAAO,MAAM;IACjB;AACH;AACD;;AAEG;AACI,MAAM,QAAQ,GAAG,IAAI,aAAa;;;;"}
@@ -102,4 +102,3 @@ declare class Duration$Type extends MessageType<Duration> {
102
102
  */
103
103
  export declare const Duration: Duration$Type;
104
104
  export {};
105
- //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1,103 @@
1
+ import { MessageType, PbLong, typeofJsonValue, reflectionMergePartial, UnknownFieldHandler, WireType } from '@protobuf-ts/runtime';
2
+
3
+ // @generated message type with reflection information, may provide speed optimized methods
4
+ class Duration$Type extends MessageType {
5
+ constructor() {
6
+ super("google.protobuf.Duration", [
7
+ { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
8
+ { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
9
+ ]);
10
+ }
11
+ /**
12
+ * Encode `Duration` to JSON string like "3.000001s".
13
+ */
14
+ internalJsonWrite(message, options) {
15
+ let s = PbLong.from(message.seconds).toNumber();
16
+ if (s > 315576000000 || s < -315576e6)
17
+ throw new Error("Duration value out of range.");
18
+ let text = message.seconds.toString();
19
+ if (s === 0 && message.nanos < 0)
20
+ text = "-" + text;
21
+ if (message.nanos !== 0) {
22
+ let nanosStr = Math.abs(message.nanos).toString();
23
+ nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr;
24
+ if (nanosStr.substring(3) === "000000")
25
+ nanosStr = nanosStr.substring(0, 3);
26
+ else if (nanosStr.substring(6) === "000")
27
+ nanosStr = nanosStr.substring(0, 6);
28
+ text += "." + nanosStr;
29
+ }
30
+ return text + "s";
31
+ }
32
+ /**
33
+ * Decode `Duration` from JSON string like "3.000001s"
34
+ */
35
+ internalJsonRead(json, options, target) {
36
+ if (typeof json !== "string")
37
+ throw new Error("Unable to parse Duration from JSON " + typeofJsonValue(json) + ". Expected string.");
38
+ let match = json.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);
39
+ if (match === null)
40
+ throw new Error("Unable to parse Duration from JSON string. Invalid format.");
41
+ if (!target)
42
+ target = this.create();
43
+ let [, sign, secs, nanos] = match;
44
+ let longSeconds = PbLong.from(sign + secs);
45
+ if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576e6)
46
+ throw new Error("Unable to parse Duration from JSON string. Value out of range.");
47
+ target.seconds = longSeconds.toBigInt();
48
+ if (typeof nanos == "string") {
49
+ let nanosStr = sign + nanos + "0".repeat(9 - nanos.length);
50
+ target.nanos = parseInt(nanosStr);
51
+ }
52
+ return target;
53
+ }
54
+ create(value) {
55
+ const message = globalThis.Object.create((this.messagePrototype));
56
+ message.seconds = 0n;
57
+ message.nanos = 0;
58
+ if (value !== undefined)
59
+ reflectionMergePartial(this, message, value);
60
+ return message;
61
+ }
62
+ internalBinaryRead(reader, length, options, target) {
63
+ let message = target ?? this.create(), end = reader.pos + length;
64
+ while (reader.pos < end) {
65
+ let [fieldNo, wireType] = reader.tag();
66
+ switch (fieldNo) {
67
+ case /* int64 seconds */ 1:
68
+ message.seconds = reader.int64().toBigInt();
69
+ break;
70
+ case /* int32 nanos */ 2:
71
+ message.nanos = reader.int32();
72
+ break;
73
+ default:
74
+ let u = options.readUnknownField;
75
+ if (u === "throw")
76
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
77
+ let d = reader.skip(wireType);
78
+ if (u !== false)
79
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
80
+ }
81
+ }
82
+ return message;
83
+ }
84
+ internalBinaryWrite(message, writer, options) {
85
+ /* int64 seconds = 1; */
86
+ if (message.seconds !== 0n)
87
+ writer.tag(1, WireType.Varint).int64(message.seconds);
88
+ /* int32 nanos = 2; */
89
+ if (message.nanos !== 0)
90
+ writer.tag(2, WireType.Varint).int32(message.nanos);
91
+ let u = options.writeUnknownFields;
92
+ if (u !== false)
93
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
94
+ return writer;
95
+ }
96
+ }
97
+ /**
98
+ * @generated MessageType for protobuf message google.protobuf.Duration
99
+ */
100
+ const Duration = new Duration$Type();
101
+
102
+ export { Duration };
103
+ //# sourceMappingURL=duration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.js","sources":["../../../../src/proto/google/protobuf/duration.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.0 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"google/protobuf/duration.proto\" (package \"google.protobuf\", syntax proto3)\n// tslint:disable\n//\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc. All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { typeofJsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonReadOptions } from \"@protobuf-ts/runtime\";\nimport type { JsonWriteOptions } from \"@protobuf-ts/runtime\";\nimport { PbLong } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * A Duration represents a signed, fixed-length span of time represented\n * as a count of seconds and fractions of seconds at nanosecond\n * resolution. It is independent of any calendar and concepts like \"day\"\n * or \"month\". It is related to Timestamp in that the difference between\n * two Timestamp values is a Duration and it can be added or subtracted\n * from a Timestamp. Range is approximately +-10,000 years.\n *\n * # Examples\n *\n * Example 1: Compute Duration from two Timestamps in pseudo code.\n *\n * Timestamp start = ...;\n * Timestamp end = ...;\n * Duration duration = ...;\n *\n * duration.seconds = end.seconds - start.seconds;\n * duration.nanos = end.nanos - start.nanos;\n *\n * if (duration.seconds < 0 && duration.nanos > 0) {\n * duration.seconds += 1;\n * duration.nanos -= 1000000000;\n * } else if (duration.seconds > 0 && duration.nanos < 0) {\n * duration.seconds -= 1;\n * duration.nanos += 1000000000;\n * }\n *\n * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.\n *\n * Timestamp start = ...;\n * Duration duration = ...;\n * Timestamp end = ...;\n *\n * end.seconds = start.seconds + duration.seconds;\n * end.nanos = start.nanos + duration.nanos;\n *\n * if (end.nanos < 0) {\n * end.seconds -= 1;\n * end.nanos += 1000000000;\n * } else if (end.nanos >= 1000000000) {\n * end.seconds += 1;\n * end.nanos -= 1000000000;\n * }\n *\n * Example 3: Compute Duration from datetime.timedelta in Python.\n *\n * td = datetime.timedelta(days=3, minutes=10)\n * duration = Duration()\n * duration.FromTimedelta(td)\n *\n * # JSON Mapping\n *\n * In JSON format, the Duration type is encoded as a string rather than an\n * object, where the string ends in the suffix \"s\" (indicating seconds) and\n * is preceded by the number of seconds, with nanoseconds expressed as\n * fractional seconds. For example, 3 seconds with 0 nanoseconds should be\n * encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should\n * be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1\n * microsecond should be expressed in JSON format as \"3.000001s\".\n *\n *\n * @generated from protobuf message google.protobuf.Duration\n */\nexport interface Duration {\n /**\n * Signed seconds of the span of time. Must be from -315,576,000,000\n * to +315,576,000,000 inclusive. Note: these bounds are computed from:\n * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years\n *\n * @generated from protobuf field: int64 seconds = 1\n */\n seconds: bigint;\n /**\n * Signed fractions of a second at nanosecond resolution of the span\n * of time. Durations less than one second are represented with a 0\n * `seconds` field and a positive or negative `nanos` field. For durations\n * of one second or more, a non-zero value for the `nanos` field must be\n * of the same sign as the `seconds` field. Must be from -999,999,999\n * to +999,999,999 inclusive.\n *\n * @generated from protobuf field: int32 nanos = 2\n */\n nanos: number;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Duration$Type extends MessageType<Duration> {\n constructor() {\n super(\"google.protobuf.Duration\", [\n { no: 1, name: \"seconds\", kind: \"scalar\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 2, name: \"nanos\", kind: \"scalar\", T: 5 /*ScalarType.INT32*/ }\n ]);\n }\n /**\n * Encode `Duration` to JSON string like \"3.000001s\".\n */\n internalJsonWrite(message: Duration, options: JsonWriteOptions): JsonValue {\n let s = PbLong.from(message.seconds).toNumber();\n if (s > 315576000000 || s < -315576000000)\n throw new Error(\"Duration value out of range.\");\n let text = message.seconds.toString();\n if (s === 0 && message.nanos < 0)\n text = \"-\" + text;\n if (message.nanos !== 0) {\n let nanosStr = Math.abs(message.nanos).toString();\n nanosStr = \"0\".repeat(9 - nanosStr.length) + nanosStr;\n if (nanosStr.substring(3) === \"000000\")\n nanosStr = nanosStr.substring(0, 3);\n else if (nanosStr.substring(6) === \"000\")\n nanosStr = nanosStr.substring(0, 6);\n text += \".\" + nanosStr;\n }\n return text + \"s\";\n }\n /**\n * Decode `Duration` from JSON string like \"3.000001s\"\n */\n internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Duration): Duration {\n if (typeof json !== \"string\")\n throw new Error(\"Unable to parse Duration from JSON \" + typeofJsonValue(json) + \". Expected string.\");\n let match = json.match(/^(-?)([0-9]+)(?:\\.([0-9]+))?s/);\n if (match === null)\n throw new Error(\"Unable to parse Duration from JSON string. Invalid format.\");\n if (!target)\n target = this.create();\n let [, sign, secs, nanos] = match;\n let longSeconds = PbLong.from(sign + secs);\n if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576000000)\n throw new Error(\"Unable to parse Duration from JSON string. Value out of range.\");\n target.seconds = longSeconds.toBigInt();\n if (typeof nanos == \"string\") {\n let nanosStr = sign + nanos + \"0\".repeat(9 - nanos.length);\n target.nanos = parseInt(nanosStr);\n }\n return target;\n }\n create(value?: PartialMessage<Duration>): Duration {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.seconds = 0n;\n message.nanos = 0;\n if (value !== undefined)\n reflectionMergePartial<Duration>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int64 seconds */ 1:\n message.seconds = reader.int64().toBigInt();\n break;\n case /* int32 nanos */ 2:\n message.nanos = reader.int32();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int64 seconds = 1; */\n if (message.seconds !== 0n)\n writer.tag(1, WireType.Varint).int64(message.seconds);\n /* int32 nanos = 2; */\n if (message.nanos !== 0)\n writer.tag(2, WireType.Varint).int32(message.nanos);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.protobuf.Duration\n */\nexport const Duration = new Duration$Type();\n"],"names":[],"mappings":";;AAoIA;AACA,MAAM,aAAc,SAAQ,WAAqB,CAAA;AAC7C,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,0BAA0B,EAAE;YAC9B,EAAE,EAAE,EAAE,CA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;QAE3G;AACA,QAAA,OAAO,OAAO;IAClB;AACA,IAAA,mBAAmB,CAAC,OAAiB,EAAE,MAAqB,EAAE,OAA2B,EAAA;;AAErF,QAAA,IAAI,OAAO,CAAC,OAAO,KAAK,EAAE;AACtB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;;AAEzD,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC;AACnB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB;QAClC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,GAAG,mBAAmB,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;AACjF,QAAA,OAAO,MAAM;IACjB;AACH;AACD;;AAEG;AACI,MAAM,QAAQ,GAAG,IAAI,aAAa;;;;"}
@@ -24,4 +24,3 @@ declare class Empty$Type extends MessageType<Empty> {
24
24
  */
25
25
  export declare const Empty: Empty$Type;
26
26
  export {};
27
- //# sourceMappingURL=empty.d.ts.map
@@ -176,4 +176,3 @@ declare class ListValue$Type extends MessageType<ListValue> {
176
176
  */
177
177
  export declare const ListValue: ListValue$Type;
178
178
  export {};
179
- //# sourceMappingURL=struct.d.ts.map
@@ -0,0 +1,133 @@
1
+ 'use strict';
2
+
3
+ var runtime = require('@protobuf-ts/runtime');
4
+
5
+ // @generated message type with reflection information, may provide speed optimized methods
6
+ class Timestamp$Type extends runtime.MessageType {
7
+ constructor() {
8
+ super("google.protobuf.Timestamp", [
9
+ { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
10
+ { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
11
+ ]);
12
+ }
13
+ /**
14
+ * Creates a new `Timestamp` for the current time.
15
+ */
16
+ now() {
17
+ const msg = this.create();
18
+ const ms = Date.now();
19
+ msg.seconds = runtime.PbLong.from(Math.floor(ms / 1000)).toBigInt();
20
+ msg.nanos = (ms % 1000) * 1000000;
21
+ return msg;
22
+ }
23
+ /**
24
+ * Converts a `Timestamp` to a JavaScript Date.
25
+ */
26
+ toDate(message) {
27
+ return new Date(runtime.PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000));
28
+ }
29
+ /**
30
+ * Converts a JavaScript Date to a `Timestamp`.
31
+ */
32
+ fromDate(date) {
33
+ const msg = this.create();
34
+ const ms = date.getTime();
35
+ msg.seconds = runtime.PbLong.from(Math.floor(ms / 1000)).toBigInt();
36
+ msg.nanos = ((ms % 1000) + (ms < 0 && ms % 1000 !== 0 ? 1000 : 0)) * 1000000;
37
+ return msg;
38
+ }
39
+ /**
40
+ * In JSON format, the `Timestamp` type is encoded as a string
41
+ * in the RFC 3339 format.
42
+ */
43
+ internalJsonWrite(message, options) {
44
+ let ms = runtime.PbLong.from(message.seconds).toNumber() * 1000;
45
+ if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
46
+ throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
47
+ if (message.nanos < 0)
48
+ throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");
49
+ let z = "Z";
50
+ if (message.nanos > 0) {
51
+ let nanosStr = (message.nanos + 1000000000).toString().substring(1);
52
+ if (nanosStr.substring(3) === "000000")
53
+ z = "." + nanosStr.substring(0, 3) + "Z";
54
+ else if (nanosStr.substring(6) === "000")
55
+ z = "." + nanosStr.substring(0, 6) + "Z";
56
+ else
57
+ z = "." + nanosStr + "Z";
58
+ }
59
+ return new Date(ms).toISOString().replace(".000Z", z);
60
+ }
61
+ /**
62
+ * In JSON format, the `Timestamp` type is encoded as a string
63
+ * in the RFC 3339 format.
64
+ */
65
+ internalJsonRead(json, options, target) {
66
+ if (typeof json !== "string")
67
+ throw new Error("Unable to parse Timestamp from JSON " + runtime.typeofJsonValue(json) + ".");
68
+ let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
69
+ if (!matches)
70
+ throw new Error("Unable to parse Timestamp from JSON. Invalid format.");
71
+ let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z"));
72
+ if (Number.isNaN(ms))
73
+ throw new Error("Unable to parse Timestamp from JSON. Invalid value.");
74
+ if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
75
+ throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
76
+ if (!target)
77
+ target = this.create();
78
+ target.seconds = runtime.PbLong.from(ms / 1000).toBigInt();
79
+ target.nanos = 0;
80
+ if (matches[7])
81
+ target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
82
+ return target;
83
+ }
84
+ create(value) {
85
+ const message = globalThis.Object.create((this.messagePrototype));
86
+ message.seconds = 0n;
87
+ message.nanos = 0;
88
+ if (value !== undefined)
89
+ runtime.reflectionMergePartial(this, message, value);
90
+ return message;
91
+ }
92
+ internalBinaryRead(reader, length, options, target) {
93
+ let message = target ?? this.create(), end = reader.pos + length;
94
+ while (reader.pos < end) {
95
+ let [fieldNo, wireType] = reader.tag();
96
+ switch (fieldNo) {
97
+ case /* int64 seconds */ 1:
98
+ message.seconds = reader.int64().toBigInt();
99
+ break;
100
+ case /* int32 nanos */ 2:
101
+ message.nanos = reader.int32();
102
+ break;
103
+ default:
104
+ let u = options.readUnknownField;
105
+ if (u === "throw")
106
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
107
+ let d = reader.skip(wireType);
108
+ if (u !== false)
109
+ (u === true ? runtime.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
110
+ }
111
+ }
112
+ return message;
113
+ }
114
+ internalBinaryWrite(message, writer, options) {
115
+ /* int64 seconds = 1; */
116
+ if (message.seconds !== 0n)
117
+ writer.tag(1, runtime.WireType.Varint).int64(message.seconds);
118
+ /* int32 nanos = 2; */
119
+ if (message.nanos !== 0)
120
+ writer.tag(2, runtime.WireType.Varint).int32(message.nanos);
121
+ let u = options.writeUnknownFields;
122
+ if (u !== false)
123
+ (u == true ? runtime.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
124
+ return writer;
125
+ }
126
+ }
127
+ /**
128
+ * @generated MessageType for protobuf message google.protobuf.Timestamp
129
+ */
130
+ const Timestamp = new Timestamp$Type();
131
+
132
+ exports.Timestamp = Timestamp;
133
+ //# sourceMappingURL=timestamp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timestamp.cjs","sources":["../../../../src/proto/google/protobuf/timestamp.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.0 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"google/protobuf/timestamp.proto\" (package \"google.protobuf\", syntax proto3)\n// tslint:disable\n//\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc. All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { typeofJsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonValue } from \"@protobuf-ts/runtime\";\nimport type { JsonReadOptions } from \"@protobuf-ts/runtime\";\nimport type { JsonWriteOptions } from \"@protobuf-ts/runtime\";\nimport { PbLong } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * A Timestamp represents a point in time independent of any time zone or local\n * calendar, encoded as a count of seconds and fractions of seconds at\n * nanosecond resolution. The count is relative to an epoch at UTC midnight on\n * January 1, 1970, in the proleptic Gregorian calendar which extends the\n * Gregorian calendar backwards to year one.\n *\n * All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n * second table is needed for interpretation, using a [24-hour linear\n * smear](https://developers.google.com/time/smear).\n *\n * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n * restricting to that range, we ensure that we can convert to and from [RFC\n * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n *\n * # Examples\n *\n * Example 1: Compute Timestamp from POSIX `time()`.\n *\n * Timestamp timestamp;\n * timestamp.set_seconds(time(NULL));\n * timestamp.set_nanos(0);\n *\n * Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n *\n * struct timeval tv;\n * gettimeofday(&tv, NULL);\n *\n * Timestamp timestamp;\n * timestamp.set_seconds(tv.tv_sec);\n * timestamp.set_nanos(tv.tv_usec * 1000);\n *\n * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n *\n * FILETIME ft;\n * GetSystemTimeAsFileTime(&ft);\n * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n *\n * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n * Timestamp timestamp;\n * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n *\n * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n *\n * long millis = System.currentTimeMillis();\n *\n * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n * .setNanos((int) ((millis % 1000) * 1000000)).build();\n *\n * Example 5: Compute Timestamp from Java `Instant.now()`.\n *\n * Instant now = Instant.now();\n *\n * Timestamp timestamp =\n * Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n * .setNanos(now.getNano()).build();\n *\n * Example 6: Compute Timestamp from current time in Python.\n *\n * timestamp = Timestamp()\n * timestamp.GetCurrentTime()\n *\n * # JSON Mapping\n *\n * In JSON format, the Timestamp type is encoded as a string in the\n * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n * format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n * where {year} is always expressed using four digits while {month}, {day},\n * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n * are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n * is required. A proto3 JSON serializer should always use UTC (as indicated by\n * \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n * able to accept both UTC and other timezones (as indicated by an offset).\n *\n * For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n * 01:30 UTC on January 15, 2017.\n *\n * In JavaScript, one can convert a Date object to this format using the\n * standard\n * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n * method. In Python, a standard `datetime.datetime` object can be converted\n * to this format using\n * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n * the Joda Time's [`ISODateTimeFormat.dateTime()`](\n * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n * ) to obtain a formatter capable of generating timestamps in this format.\n *\n *\n * @generated from protobuf message google.protobuf.Timestamp\n */\nexport interface Timestamp {\n /**\n * Represents seconds of UTC time since Unix epoch\n * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59Z inclusive.\n *\n * @generated from protobuf field: int64 seconds = 1\n */\n seconds: bigint;\n /**\n * Non-negative fractions of a second at nanosecond resolution. Negative\n * second values with fractions must still have non-negative nanos values\n * that count forward in time. Must be from 0 to 999,999,999\n * inclusive.\n *\n * @generated from protobuf field: int32 nanos = 2\n */\n nanos: number;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Timestamp$Type extends MessageType<Timestamp> {\n constructor() {\n super(\"google.protobuf.Timestamp\", [\n { no: 1, name: \"seconds\", kind: \"scalar\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 2, name: \"nanos\", kind: \"scalar\", T: 5 /*ScalarType.INT32*/ }\n ]);\n }\n /**\n * Creates a new `Timestamp` for the current time.\n */\n now(): Timestamp {\n const msg = this.create();\n const ms = Date.now();\n msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();\n msg.nanos = (ms % 1000) * 1000000;\n return msg;\n }\n /**\n * Converts a `Timestamp` to a JavaScript Date.\n */\n toDate(message: Timestamp): Date {\n return new Date(PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000));\n }\n /**\n * Converts a JavaScript Date to a `Timestamp`.\n */\n fromDate(date: Date): Timestamp {\n const msg = this.create();\n const ms = date.getTime();\n msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();\n msg.nanos = ((ms % 1000) + (ms < 0 && ms % 1000 !== 0 ? 1000 : 0)) * 1000000;\n return msg;\n }\n /**\n * In JSON format, the `Timestamp` type is encoded as a string\n * in the RFC 3339 format.\n */\n internalJsonWrite(message: Timestamp, options: JsonWriteOptions): JsonValue {\n let ms = PbLong.from(message.seconds).toNumber() * 1000;\n if (ms < Date.parse(\"0001-01-01T00:00:00Z\") || ms > Date.parse(\"9999-12-31T23:59:59Z\"))\n throw new Error(\"Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.\");\n if (message.nanos < 0)\n throw new Error(\"Unable to encode invalid Timestamp to JSON. Nanos must not be negative.\");\n let z = \"Z\";\n if (message.nanos > 0) {\n let nanosStr = (message.nanos + 1000000000).toString().substring(1);\n if (nanosStr.substring(3) === \"000000\")\n z = \".\" + nanosStr.substring(0, 3) + \"Z\";\n else if (nanosStr.substring(6) === \"000\")\n z = \".\" + nanosStr.substring(0, 6) + \"Z\";\n else\n z = \".\" + nanosStr + \"Z\";\n }\n return new Date(ms).toISOString().replace(\".000Z\", z);\n }\n /**\n * In JSON format, the `Timestamp` type is encoded as a string\n * in the RFC 3339 format.\n */\n internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Timestamp): Timestamp {\n if (typeof json !== \"string\")\n throw new Error(\"Unable to parse Timestamp from JSON \" + typeofJsonValue(json) + \".\");\n let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);\n if (!matches)\n throw new Error(\"Unable to parse Timestamp from JSON. Invalid format.\");\n let ms = Date.parse(matches[1] + \"-\" + matches[2] + \"-\" + matches[3] + \"T\" + matches[4] + \":\" + matches[5] + \":\" + matches[6] + (matches[8] ? matches[8] : \"Z\"));\n if (Number.isNaN(ms))\n throw new Error(\"Unable to parse Timestamp from JSON. Invalid value.\");\n if (ms < Date.parse(\"0001-01-01T00:00:00Z\") || ms > Date.parse(\"9999-12-31T23:59:59Z\"))\n throw new globalThis.Error(\"Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.\");\n if (!target)\n target = this.create();\n target.seconds = PbLong.from(ms / 1000).toBigInt();\n target.nanos = 0;\n if (matches[7])\n target.nanos = (parseInt(\"1\" + matches[7] + \"0\".repeat(9 - matches[7].length)) - 1000000000);\n return target;\n }\n create(value?: PartialMessage<Timestamp>): Timestamp {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.seconds = 0n;\n message.nanos = 0;\n if (value !== undefined)\n reflectionMergePartial<Timestamp>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Timestamp): Timestamp {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int64 seconds */ 1:\n message.seconds = reader.int64().toBigInt();\n break;\n case /* int32 nanos */ 2:\n message.nanos = reader.int32();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Timestamp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int64 seconds = 1; */\n if (message.seconds !== 0n)\n writer.tag(1, WireType.Varint).int64(message.seconds);\n /* int32 nanos = 2; */\n if (message.nanos !== 0)\n writer.tag(2, WireType.Varint).int32(message.nanos);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.protobuf.Timestamp\n */\nexport const Timestamp = new Timestamp$Type();\n"],"names":["MessageType","PbLong","typeofJsonValue","reflectionMergePartial","UnknownFieldHandler","WireType"],"mappings":";;;;AAiKA;AACA,MAAM,cAAe,SAAQA,mBAAsB,CAAA;AAC/C,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,2BAA2B,EAAE;YAC/B,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,uBAAuB,CAAC,EAAE,CAAC,sBAAsB;AAC/F,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AAC/C,SAAA,CAAC;IACN;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CAAC;oBAC7B,IAAI,CAAC,KAAK,KAAK;wBACX,CAAC,CAAC,KAAK,IAAI,GAAGC,2BAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;;QAE3G;AACA,QAAA,OAAO,OAAO;IAClB;AACA,IAAA,mBAAmB,CAAC,OAAkB,EAAE,MAAqB,EAAE,OAA2B,EAAA;;AAEtF,QAAA,IAAI,OAAO,CAAC,OAAO,KAAK,EAAE;AACtB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEC,gBAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;;AAEzD,QAAA,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC;AACnB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEA,gBAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB;QAClC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,GAAGD,2BAAmB,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;AACjF,QAAA,OAAO,MAAM;IACjB;AACH;AACD;;AAEG;AACI,MAAM,SAAS,GAAG,IAAI,cAAc;;;;"}
@@ -145,4 +145,3 @@ declare class Timestamp$Type extends MessageType<Timestamp> {
145
145
  */
146
146
  export declare const Timestamp: Timestamp$Type;
147
147
  export {};
148
- //# sourceMappingURL=timestamp.d.ts.map
@@ -0,0 +1,131 @@
1
+ import { MessageType, PbLong, typeofJsonValue, reflectionMergePartial, UnknownFieldHandler, WireType } from '@protobuf-ts/runtime';
2
+
3
+ // @generated message type with reflection information, may provide speed optimized methods
4
+ class Timestamp$Type extends MessageType {
5
+ constructor() {
6
+ super("google.protobuf.Timestamp", [
7
+ { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
8
+ { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
9
+ ]);
10
+ }
11
+ /**
12
+ * Creates a new `Timestamp` for the current time.
13
+ */
14
+ now() {
15
+ const msg = this.create();
16
+ const ms = Date.now();
17
+ msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
18
+ msg.nanos = (ms % 1000) * 1000000;
19
+ return msg;
20
+ }
21
+ /**
22
+ * Converts a `Timestamp` to a JavaScript Date.
23
+ */
24
+ toDate(message) {
25
+ return new Date(PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000));
26
+ }
27
+ /**
28
+ * Converts a JavaScript Date to a `Timestamp`.
29
+ */
30
+ fromDate(date) {
31
+ const msg = this.create();
32
+ const ms = date.getTime();
33
+ msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
34
+ msg.nanos = ((ms % 1000) + (ms < 0 && ms % 1000 !== 0 ? 1000 : 0)) * 1000000;
35
+ return msg;
36
+ }
37
+ /**
38
+ * In JSON format, the `Timestamp` type is encoded as a string
39
+ * in the RFC 3339 format.
40
+ */
41
+ internalJsonWrite(message, options) {
42
+ let ms = PbLong.from(message.seconds).toNumber() * 1000;
43
+ if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
44
+ throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
45
+ if (message.nanos < 0)
46
+ throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");
47
+ let z = "Z";
48
+ if (message.nanos > 0) {
49
+ let nanosStr = (message.nanos + 1000000000).toString().substring(1);
50
+ if (nanosStr.substring(3) === "000000")
51
+ z = "." + nanosStr.substring(0, 3) + "Z";
52
+ else if (nanosStr.substring(6) === "000")
53
+ z = "." + nanosStr.substring(0, 6) + "Z";
54
+ else
55
+ z = "." + nanosStr + "Z";
56
+ }
57
+ return new Date(ms).toISOString().replace(".000Z", z);
58
+ }
59
+ /**
60
+ * In JSON format, the `Timestamp` type is encoded as a string
61
+ * in the RFC 3339 format.
62
+ */
63
+ internalJsonRead(json, options, target) {
64
+ if (typeof json !== "string")
65
+ throw new Error("Unable to parse Timestamp from JSON " + typeofJsonValue(json) + ".");
66
+ let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
67
+ if (!matches)
68
+ throw new Error("Unable to parse Timestamp from JSON. Invalid format.");
69
+ let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z"));
70
+ if (Number.isNaN(ms))
71
+ throw new Error("Unable to parse Timestamp from JSON. Invalid value.");
72
+ if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
73
+ throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
74
+ if (!target)
75
+ target = this.create();
76
+ target.seconds = PbLong.from(ms / 1000).toBigInt();
77
+ target.nanos = 0;
78
+ if (matches[7])
79
+ target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
80
+ return target;
81
+ }
82
+ create(value) {
83
+ const message = globalThis.Object.create((this.messagePrototype));
84
+ message.seconds = 0n;
85
+ message.nanos = 0;
86
+ if (value !== undefined)
87
+ reflectionMergePartial(this, message, value);
88
+ return message;
89
+ }
90
+ internalBinaryRead(reader, length, options, target) {
91
+ let message = target ?? this.create(), end = reader.pos + length;
92
+ while (reader.pos < end) {
93
+ let [fieldNo, wireType] = reader.tag();
94
+ switch (fieldNo) {
95
+ case /* int64 seconds */ 1:
96
+ message.seconds = reader.int64().toBigInt();
97
+ break;
98
+ case /* int32 nanos */ 2:
99
+ message.nanos = reader.int32();
100
+ break;
101
+ default:
102
+ let u = options.readUnknownField;
103
+ if (u === "throw")
104
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
105
+ let d = reader.skip(wireType);
106
+ if (u !== false)
107
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
108
+ }
109
+ }
110
+ return message;
111
+ }
112
+ internalBinaryWrite(message, writer, options) {
113
+ /* int64 seconds = 1; */
114
+ if (message.seconds !== 0n)
115
+ writer.tag(1, WireType.Varint).int64(message.seconds);
116
+ /* int32 nanos = 2; */
117
+ if (message.nanos !== 0)
118
+ writer.tag(2, WireType.Varint).int32(message.nanos);
119
+ let u = options.writeUnknownFields;
120
+ if (u !== false)
121
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
122
+ return writer;
123
+ }
124
+ }
125
+ /**
126
+ * @generated MessageType for protobuf message google.protobuf.Timestamp
127
+ */
128
+ const Timestamp = new Timestamp$Type();
129
+
130
+ export { Timestamp };
131
+ //# sourceMappingURL=timestamp.js.map