@streamr/trackerless-network 0.0.1-tatum.0

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 (262) hide show
  1. package/.eslintignore +7 -0
  2. package/.eslintrc +3 -0
  3. package/README.md +6 -0
  4. package/bin/bootstrap-node.ts +73 -0
  5. package/bin/full-node-webrtc.ts +102 -0
  6. package/bin/full-node-websocket.ts +102 -0
  7. package/bin/network.ts +43 -0
  8. package/dist/package.json +53 -0
  9. package/dist/src/NameDirectory.d.ts +5 -0
  10. package/dist/src/NameDirectory.js +44 -0
  11. package/dist/src/NameDirectory.js.map +1 -0
  12. package/dist/src/NetworkNode.d.ts +35 -0
  13. package/dist/src/NetworkNode.js +130 -0
  14. package/dist/src/NetworkNode.js.map +1 -0
  15. package/dist/src/NetworkStack.d.ts +32 -0
  16. package/dist/src/NetworkStack.js +108 -0
  17. package/dist/src/NetworkStack.js.map +1 -0
  18. package/dist/src/exports.d.ts +6 -0
  19. package/dist/src/exports.js +12 -0
  20. package/dist/src/exports.js.map +1 -0
  21. package/dist/src/identifiers.d.ts +1 -0
  22. package/dist/src/identifiers.js +3 -0
  23. package/dist/src/identifiers.js.map +1 -0
  24. package/dist/src/logic/DuplicateMessageDetector.d.ts +55 -0
  25. package/dist/src/logic/DuplicateMessageDetector.js +155 -0
  26. package/dist/src/logic/DuplicateMessageDetector.js.map +1 -0
  27. package/dist/src/logic/ILayer0.d.ts +13 -0
  28. package/dist/src/logic/ILayer0.js +3 -0
  29. package/dist/src/logic/ILayer0.js.map +1 -0
  30. package/dist/src/logic/IStreamNode.d.ts +12 -0
  31. package/dist/src/logic/IStreamNode.js +3 -0
  32. package/dist/src/logic/IStreamNode.js.map +1 -0
  33. package/dist/src/logic/PeerList.d.ts +27 -0
  34. package/dist/src/logic/PeerList.js +84 -0
  35. package/dist/src/logic/PeerList.js.map +1 -0
  36. package/dist/src/logic/RandomGraphNode.d.ts +68 -0
  37. package/dist/src/logic/RandomGraphNode.js +201 -0
  38. package/dist/src/logic/RandomGraphNode.js.map +1 -0
  39. package/dist/src/logic/Remote.d.ts +9 -0
  40. package/dist/src/logic/Remote.js +15 -0
  41. package/dist/src/logic/Remote.js.map +1 -0
  42. package/dist/src/logic/RemoteRandomGraphNode.d.ts +8 -0
  43. package/dist/src/logic/RemoteRandomGraphNode.js +35 -0
  44. package/dist/src/logic/RemoteRandomGraphNode.js.map +1 -0
  45. package/dist/src/logic/StreamEntryPointDiscovery.d.ts +36 -0
  46. package/dist/src/logic/StreamEntryPointDiscovery.js +179 -0
  47. package/dist/src/logic/StreamEntryPointDiscovery.js.map +1 -0
  48. package/dist/src/logic/StreamNodeServer.d.ts +20 -0
  49. package/dist/src/logic/StreamNodeServer.js +26 -0
  50. package/dist/src/logic/StreamNodeServer.js.map +1 -0
  51. package/dist/src/logic/StreamrNode.d.ts +76 -0
  52. package/dist/src/logic/StreamrNode.js +303 -0
  53. package/dist/src/logic/StreamrNode.js.map +1 -0
  54. package/dist/src/logic/createRandomGraphNode.d.ts +5 -0
  55. package/dist/src/logic/createRandomGraphNode.js +110 -0
  56. package/dist/src/logic/createRandomGraphNode.js.map +1 -0
  57. package/dist/src/logic/inspect/InspectSession.d.ts +18 -0
  58. package/dist/src/logic/inspect/InspectSession.js +38 -0
  59. package/dist/src/logic/inspect/InspectSession.js.map +1 -0
  60. package/dist/src/logic/inspect/Inspector.d.ts +33 -0
  61. package/dist/src/logic/inspect/Inspector.js +63 -0
  62. package/dist/src/logic/inspect/Inspector.js.map +1 -0
  63. package/dist/src/logic/neighbor-discovery/Handshaker.d.ts +35 -0
  64. package/dist/src/logic/neighbor-discovery/Handshaker.js +121 -0
  65. package/dist/src/logic/neighbor-discovery/Handshaker.js.map +1 -0
  66. package/dist/src/logic/neighbor-discovery/HandshakerServer.d.ts +30 -0
  67. package/dist/src/logic/neighbor-discovery/HandshakerServer.js +78 -0
  68. package/dist/src/logic/neighbor-discovery/HandshakerServer.js.map +1 -0
  69. package/dist/src/logic/neighbor-discovery/NeighborFinder.d.ts +23 -0
  70. package/dist/src/logic/neighbor-discovery/NeighborFinder.js +44 -0
  71. package/dist/src/logic/neighbor-discovery/NeighborFinder.js.map +1 -0
  72. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.d.ts +30 -0
  73. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.js +42 -0
  74. package/dist/src/logic/neighbor-discovery/NeighborUpdateManager.js.map +1 -0
  75. package/dist/src/logic/neighbor-discovery/NeighborUpdateManagerServer.d.ts +20 -0
  76. package/dist/src/logic/neighbor-discovery/NeighborUpdateManagerServer.js +42 -0
  77. package/dist/src/logic/neighbor-discovery/NeighborUpdateManagerServer.js.map +1 -0
  78. package/dist/src/logic/neighbor-discovery/RemoteHandshaker.d.ts +12 -0
  79. package/dist/src/logic/neighbor-discovery/RemoteHandshaker.js +54 -0
  80. package/dist/src/logic/neighbor-discovery/RemoteHandshaker.js.map +1 -0
  81. package/dist/src/logic/neighbor-discovery/RemoteNeighborUpdateManager.d.ts +11 -0
  82. package/dist/src/logic/neighbor-discovery/RemoteNeighborUpdateManager.js +37 -0
  83. package/dist/src/logic/neighbor-discovery/RemoteNeighborUpdateManager.js.map +1 -0
  84. package/dist/src/logic/propagation/FifoMapWithTTL.d.ts +36 -0
  85. package/dist/src/logic/propagation/FifoMapWithTTL.js +81 -0
  86. package/dist/src/logic/propagation/FifoMapWithTTL.js.map +1 -0
  87. package/dist/src/logic/propagation/Propagation.d.ts +31 -0
  88. package/dist/src/logic/propagation/Propagation.js +64 -0
  89. package/dist/src/logic/propagation/Propagation.js.map +1 -0
  90. package/dist/src/logic/propagation/PropagationTaskStore.d.ts +21 -0
  91. package/dist/src/logic/propagation/PropagationTaskStore.js +32 -0
  92. package/dist/src/logic/propagation/PropagationTaskStore.js.map +1 -0
  93. package/dist/src/logic/protocol-integration/stream-message/ContentMessageTranslator.d.ts +5 -0
  94. package/dist/src/logic/protocol-integration/stream-message/ContentMessageTranslator.js +17 -0
  95. package/dist/src/logic/protocol-integration/stream-message/ContentMessageTranslator.js.map +1 -0
  96. package/dist/src/logic/protocol-integration/stream-message/GroupKeyRequestTranslator.d.ts +6 -0
  97. package/dist/src/logic/protocol-integration/stream-message/GroupKeyRequestTranslator.js +27 -0
  98. package/dist/src/logic/protocol-integration/stream-message/GroupKeyRequestTranslator.js.map +1 -0
  99. package/dist/src/logic/protocol-integration/stream-message/GroupKeyResponseTranslator.d.ts +6 -0
  100. package/dist/src/logic/protocol-integration/stream-message/GroupKeyResponseTranslator.js +33 -0
  101. package/dist/src/logic/protocol-integration/stream-message/GroupKeyResponseTranslator.js.map +1 -0
  102. package/dist/src/logic/protocol-integration/stream-message/StreamMessageTranslator.d.ts +6 -0
  103. package/dist/src/logic/protocol-integration/stream-message/StreamMessageTranslator.js +109 -0
  104. package/dist/src/logic/protocol-integration/stream-message/StreamMessageTranslator.js.map +1 -0
  105. package/dist/src/logic/proxy/ProxyStreamConnectionClient.d.ts +44 -0
  106. package/dist/src/logic/proxy/ProxyStreamConnectionClient.js +189 -0
  107. package/dist/src/logic/proxy/ProxyStreamConnectionClient.js.map +1 -0
  108. package/dist/src/logic/proxy/ProxyStreamConnectionServer.d.ts +34 -0
  109. package/dist/src/logic/proxy/ProxyStreamConnectionServer.js +64 -0
  110. package/dist/src/logic/proxy/ProxyStreamConnectionServer.js.map +1 -0
  111. package/dist/src/logic/proxy/RemoteProxyServer.d.ts +7 -0
  112. package/dist/src/logic/proxy/RemoteProxyServer.js +36 -0
  113. package/dist/src/logic/proxy/RemoteProxyServer.js.map +1 -0
  114. package/dist/src/logic/temporary-connection/RemoteTemporaryConnectionRpcServer.d.ts +6 -0
  115. package/dist/src/logic/temporary-connection/RemoteTemporaryConnectionRpcServer.js +28 -0
  116. package/dist/src/logic/temporary-connection/RemoteTemporaryConnectionRpcServer.js.map +1 -0
  117. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcServer.d.ts +20 -0
  118. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcServer.js +29 -0
  119. package/dist/src/logic/temporary-connection/TemporaryConnectionRpcServer.js.map +1 -0
  120. package/dist/src/logic/utils.d.ts +3 -0
  121. package/dist/src/logic/utils.js +16 -0
  122. package/dist/src/logic/utils.js.map +1 -0
  123. package/dist/src/proto/google/protobuf/any.d.ts +173 -0
  124. package/dist/src/proto/google/protobuf/any.js +155 -0
  125. package/dist/src/proto/google/protobuf/any.js.map +1 -0
  126. package/dist/src/proto/google/protobuf/empty.d.ts +32 -0
  127. package/dist/src/proto/google/protobuf/empty.js +34 -0
  128. package/dist/src/proto/google/protobuf/empty.js.map +1 -0
  129. package/dist/src/proto/google/protobuf/timestamp.d.ts +149 -0
  130. package/dist/src/proto/google/protobuf/timestamp.js +136 -0
  131. package/dist/src/proto/google/protobuf/timestamp.js.map +1 -0
  132. package/dist/src/proto/packages/dht/protos/DhtRpc.client.d.ts +320 -0
  133. package/dist/src/proto/packages/dht/protos/DhtRpc.client.js +245 -0
  134. package/dist/src/proto/packages/dht/protos/DhtRpc.client.js.map +1 -0
  135. package/dist/src/proto/packages/dht/protos/DhtRpc.d.ts +1089 -0
  136. package/dist/src/proto/packages/dht/protos/DhtRpc.js +710 -0
  137. package/dist/src/proto/packages/dht/protos/DhtRpc.js.map +1 -0
  138. package/dist/src/proto/packages/dht/protos/DhtRpc.server.d.ts +145 -0
  139. package/dist/src/proto/packages/dht/protos/DhtRpc.server.js +3 -0
  140. package/dist/src/proto/packages/dht/protos/DhtRpc.server.js.map +1 -0
  141. package/dist/src/proto/packages/proto-rpc/protos/ProtoRpc.d.ts +87 -0
  142. package/dist/src/proto/packages/proto-rpc/protos/ProtoRpc.js +66 -0
  143. package/dist/src/proto/packages/proto-rpc/protos/ProtoRpc.js.map +1 -0
  144. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.d.ts +156 -0
  145. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.js +122 -0
  146. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.client.js.map +1 -0
  147. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.d.ts +524 -0
  148. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.js +350 -0
  149. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.js.map +1 -0
  150. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.server.d.ts +65 -0
  151. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.server.js +3 -0
  152. package/dist/src/proto/packages/trackerless-network/protos/NetworkRpc.server.js.map +1 -0
  153. package/dist/test/benchmark/first-message.d.ts +1 -0
  154. package/dist/test/benchmark/first-message.js +137 -0
  155. package/dist/test/benchmark/first-message.js.map +1 -0
  156. package/dist/test/utils/utils.d.ts +12 -0
  157. package/dist/test/utils/utils.js +86 -0
  158. package/dist/test/utils/utils.js.map +1 -0
  159. package/jest.config.js +36 -0
  160. package/karma.config.js +20 -0
  161. package/log.txt +501 -0
  162. package/package.json +53 -0
  163. package/proto.sh +2 -0
  164. package/protos/NetworkRpc.proto +161 -0
  165. package/src/NameDirectory.ts +44 -0
  166. package/src/NetworkNode.ts +169 -0
  167. package/src/NetworkStack.ts +144 -0
  168. package/src/exports.ts +6 -0
  169. package/src/identifiers.ts +1 -0
  170. package/src/logic/DuplicateMessageDetector.ts +167 -0
  171. package/src/logic/ILayer0.ts +14 -0
  172. package/src/logic/IStreamNode.ts +17 -0
  173. package/src/logic/PeerList.ts +106 -0
  174. package/src/logic/RandomGraphNode.ts +310 -0
  175. package/src/logic/Remote.ts +19 -0
  176. package/src/logic/RemoteRandomGraphNode.ts +39 -0
  177. package/src/logic/StreamEntryPointDiscovery.ts +221 -0
  178. package/src/logic/StreamNodeServer.ts +44 -0
  179. package/src/logic/StreamrNode.ts +416 -0
  180. package/src/logic/createRandomGraphNode.ts +114 -0
  181. package/src/logic/inspect/InspectSession.ts +49 -0
  182. package/src/logic/inspect/Inspector.ts +89 -0
  183. package/src/logic/neighbor-discovery/Handshaker.ts +180 -0
  184. package/src/logic/neighbor-discovery/HandshakerServer.ts +99 -0
  185. package/src/logic/neighbor-discovery/NeighborFinder.ts +61 -0
  186. package/src/logic/neighbor-discovery/NeighborUpdateManager.ts +67 -0
  187. package/src/logic/neighbor-discovery/NeighborUpdateManagerServer.ts +61 -0
  188. package/src/logic/neighbor-discovery/RemoteHandshaker.ts +64 -0
  189. package/src/logic/neighbor-discovery/RemoteNeighborUpdateManager.ts +41 -0
  190. package/src/logic/propagation/FifoMapWithTTL.ts +108 -0
  191. package/src/logic/propagation/Propagation.ts +83 -0
  192. package/src/logic/propagation/PropagationTaskStore.ts +40 -0
  193. package/src/logic/protocol-integration/stream-message/ContentMessageTranslator.ts +16 -0
  194. package/src/logic/protocol-integration/stream-message/GroupKeyRequestTranslator.ts +28 -0
  195. package/src/logic/protocol-integration/stream-message/GroupKeyResponseTranslator.ts +38 -0
  196. package/src/logic/protocol-integration/stream-message/StreamMessageTranslator.ts +142 -0
  197. package/src/logic/proxy/ProxyStreamConnectionClient.ts +255 -0
  198. package/src/logic/proxy/ProxyStreamConnectionServer.ts +97 -0
  199. package/src/logic/proxy/RemoteProxyServer.ts +36 -0
  200. package/src/logic/temporary-connection/RemoteTemporaryConnectionRpcServer.ts +27 -0
  201. package/src/logic/temporary-connection/TemporaryConnectionRpcServer.ts +50 -0
  202. package/src/logic/utils.ts +17 -0
  203. package/src/proto/google/protobuf/any.ts +319 -0
  204. package/src/proto/google/protobuf/empty.ts +84 -0
  205. package/src/proto/google/protobuf/timestamp.ts +281 -0
  206. package/src/proto/packages/dht/protos/DhtRpc.client.ts +373 -0
  207. package/src/proto/packages/dht/protos/DhtRpc.server.ts +148 -0
  208. package/src/proto/packages/dht/protos/DhtRpc.ts +1399 -0
  209. package/src/proto/packages/proto-rpc/protos/ProtoRpc.ts +108 -0
  210. package/src/proto/packages/trackerless-network/protos/NetworkRpc.client.ts +176 -0
  211. package/src/proto/packages/trackerless-network/protos/NetworkRpc.server.ts +68 -0
  212. package/src/proto/packages/trackerless-network/protos/NetworkRpc.ts +667 -0
  213. package/test/benchmark/first-message.ts +155 -0
  214. package/test/end-to-end/inspect.test.ts +119 -0
  215. package/test/end-to-end/proxy-and-full-node.test.ts +140 -0
  216. package/test/end-to-end/proxy-connections.test.ts +228 -0
  217. package/test/end-to-end/proxy-key-exchange.test.ts +142 -0
  218. package/test/end-to-end/random-graph-with-real-connections.test.ts +154 -0
  219. package/test/end-to-end/webrtc-full-node-network.test.ts +97 -0
  220. package/test/end-to-end/websocket-full-node-network.test.ts +93 -0
  221. package/test/integration/Handshakes.test.ts +167 -0
  222. package/test/integration/Inspect.test.ts +102 -0
  223. package/test/integration/NetworkNode.test.ts +99 -0
  224. package/test/integration/NetworkRpc.test.ts +61 -0
  225. package/test/integration/NetworkStack.test.ts +74 -0
  226. package/test/integration/NetworkStackStoppedDuringStart.test.ts +45 -0
  227. package/test/integration/Propagation.test.ts +79 -0
  228. package/test/integration/RandomGraphNode-Layer1Node-Latencies.test.ts +141 -0
  229. package/test/integration/RandomGraphNode-Layer1Node.test.ts +226 -0
  230. package/test/integration/RemoteHandshaker.test.ts +78 -0
  231. package/test/integration/RemoteNeighborUpdateManager.test.ts +82 -0
  232. package/test/integration/RemoteRandomGraphNode.test.ts +102 -0
  233. package/test/integration/StreamrNode.test.ts +145 -0
  234. package/test/integration/stream-without-default-entrypoints.test.ts +132 -0
  235. package/test/unit/ContentMessageTranslator.test.ts +20 -0
  236. package/test/unit/DuplicateMessageDetector.test.ts +192 -0
  237. package/test/unit/FifoMapWithTtl.test.ts +229 -0
  238. package/test/unit/GroupKeyRequestTranslator.test.ts +36 -0
  239. package/test/unit/GroupKeyResponseTranslator.test.ts +39 -0
  240. package/test/unit/Handshaker.test.ts +63 -0
  241. package/test/unit/HandshakerServer.test.ts +123 -0
  242. package/test/unit/InspectSession.test.ts +78 -0
  243. package/test/unit/Inspector.test.ts +57 -0
  244. package/test/unit/NeighborFinder.test.ts +48 -0
  245. package/test/unit/NumberPair.test.ts +22 -0
  246. package/test/unit/PeerList.test.ts +150 -0
  247. package/test/unit/Propagation.test.ts +134 -0
  248. package/test/unit/RandomGraphNode.test.ts +73 -0
  249. package/test/unit/StreamEntrypointDiscovery.test.ts +152 -0
  250. package/test/unit/StreamMessageTranslator.test.ts +67 -0
  251. package/test/unit/StreamNodeServer.test.ts +63 -0
  252. package/test/unit/StreamrNode.test.ts +74 -0
  253. package/test/utils/mock/MockHandshaker.ts +15 -0
  254. package/test/utils/mock/MockLayer0.ts +71 -0
  255. package/test/utils/mock/MockLayer1.ts +6 -0
  256. package/test/utils/mock/MockNeighborFinder.ts +19 -0
  257. package/test/utils/mock/MockNeighborUpdateManager.ts +21 -0
  258. package/test/utils/mock/Transport.ts +25 -0
  259. package/test/utils/utils.ts +104 -0
  260. package/tsconfig.browser.json +12 -0
  261. package/tsconfig.jest.json +15 -0
  262. package/tsconfig.node.json +18 -0
@@ -0,0 +1,173 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
4
+ import type { PartialMessage } from "@protobuf-ts/runtime";
5
+ import type { JsonValue } from "@protobuf-ts/runtime";
6
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
7
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
8
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
+ import type { IMessageType } from "@protobuf-ts/runtime";
10
+ import { MessageType } from "@protobuf-ts/runtime";
11
+ /**
12
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
13
+ * URL that describes the type of the serialized message.
14
+ *
15
+ * Protobuf library provides support to pack/unpack Any values in the form
16
+ * of utility functions or additional generated methods of the Any type.
17
+ *
18
+ * Example 1: Pack and unpack a message in C++.
19
+ *
20
+ * Foo foo = ...;
21
+ * Any any;
22
+ * any.PackFrom(foo);
23
+ * ...
24
+ * if (any.UnpackTo(&foo)) {
25
+ * ...
26
+ * }
27
+ *
28
+ * Example 2: Pack and unpack a message in Java.
29
+ *
30
+ * Foo foo = ...;
31
+ * Any any = Any.pack(foo);
32
+ * ...
33
+ * if (any.is(Foo.class)) {
34
+ * foo = any.unpack(Foo.class);
35
+ * }
36
+ *
37
+ * Example 3: Pack and unpack a message in Python.
38
+ *
39
+ * foo = Foo(...)
40
+ * any = Any()
41
+ * any.Pack(foo)
42
+ * ...
43
+ * if any.Is(Foo.DESCRIPTOR):
44
+ * any.Unpack(foo)
45
+ * ...
46
+ *
47
+ * Example 4: Pack and unpack a message in Go
48
+ *
49
+ * foo := &pb.Foo{...}
50
+ * any, err := ptypes.MarshalAny(foo)
51
+ * ...
52
+ * foo := &pb.Foo{}
53
+ * if err := ptypes.UnmarshalAny(any, foo); err != nil {
54
+ * ...
55
+ * }
56
+ *
57
+ * The pack methods provided by protobuf library will by default use
58
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
59
+ * methods only use the fully qualified type name after the last '/'
60
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
61
+ * name "y.z".
62
+ *
63
+ *
64
+ * JSON
65
+ * ====
66
+ * The JSON representation of an `Any` value uses the regular
67
+ * representation of the deserialized, embedded message, with an
68
+ * additional field `@type` which contains the type URL. Example:
69
+ *
70
+ * package google.profile;
71
+ * message Person {
72
+ * string first_name = 1;
73
+ * string last_name = 2;
74
+ * }
75
+ *
76
+ * {
77
+ * "@type": "type.googleapis.com/google.profile.Person",
78
+ * "firstName": <string>,
79
+ * "lastName": <string>
80
+ * }
81
+ *
82
+ * If the embedded message type is well-known and has a custom JSON
83
+ * representation, that representation will be embedded adding a field
84
+ * `value` which holds the custom JSON in addition to the `@type`
85
+ * field. Example (for message [google.protobuf.Duration][]):
86
+ *
87
+ * {
88
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
89
+ * "value": "1.212s"
90
+ * }
91
+ *
92
+ *
93
+ * @generated from protobuf message google.protobuf.Any
94
+ */
95
+ export interface Any {
96
+ /**
97
+ * A URL/resource name that uniquely identifies the type of the serialized
98
+ * protocol buffer message. This string must contain at least
99
+ * one "/" character. The last segment of the URL's path must represent
100
+ * the fully qualified name of the type (as in
101
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
102
+ * (e.g., leading "." is not accepted).
103
+ *
104
+ * In practice, teams usually precompile into the binary all types that they
105
+ * expect it to use in the context of Any. However, for URLs which use the
106
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
107
+ * server that maps type URLs to message definitions as follows:
108
+ *
109
+ * * If no scheme is provided, `https` is assumed.
110
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
111
+ * value in binary format, or produce an error.
112
+ * * Applications are allowed to cache lookup results based on the
113
+ * URL, or have them precompiled into a binary to avoid any
114
+ * lookup. Therefore, binary compatibility needs to be preserved
115
+ * on changes to types. (Use versioned type names to manage
116
+ * breaking changes.)
117
+ *
118
+ * Note: this functionality is not currently available in the official
119
+ * protobuf release, and it is not used for type URLs beginning with
120
+ * type.googleapis.com.
121
+ *
122
+ * Schemes other than `http`, `https` (or the empty scheme) might be
123
+ * used with implementation specific semantics.
124
+ *
125
+ *
126
+ * @generated from protobuf field: string type_url = 1;
127
+ */
128
+ typeUrl: string;
129
+ /**
130
+ * Must be a valid serialized protocol buffer of the above specified type.
131
+ *
132
+ * @generated from protobuf field: bytes value = 2;
133
+ */
134
+ value: Uint8Array;
135
+ }
136
+ declare class Any$Type extends MessageType<Any> {
137
+ constructor();
138
+ /**
139
+ * Pack the message into a new `Any`.
140
+ *
141
+ * Uses 'type.googleapis.com/full.type.name' as the type URL.
142
+ */
143
+ pack<T extends object>(message: T, type: IMessageType<T>): Any;
144
+ /**
145
+ * Unpack the message from the `Any`.
146
+ */
147
+ unpack<T extends object>(any: Any, type: IMessageType<T>, options?: Partial<BinaryReadOptions>): T;
148
+ /**
149
+ * Does the given `Any` contain a packed message of the given type?
150
+ */
151
+ contains(any: Any, type: IMessageType<any> | string): boolean;
152
+ /**
153
+ * Convert the message to canonical JSON value.
154
+ *
155
+ * You have to provide the `typeRegistry` option so that the
156
+ * packed message can be converted to JSON.
157
+ *
158
+ * The `typeRegistry` option is also required to read
159
+ * `google.protobuf.Any` from JSON format.
160
+ */
161
+ internalJsonWrite(any: Any, options: JsonWriteOptions): JsonValue;
162
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Any): Any;
163
+ typeNameToUrl(name: string): string;
164
+ typeUrlToName(url: string): string;
165
+ create(value?: PartialMessage<Any>): Any;
166
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Any): Any;
167
+ internalBinaryWrite(message: Any, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
168
+ }
169
+ /**
170
+ * @generated MessageType for protobuf message google.protobuf.Any
171
+ */
172
+ export declare const Any: Any$Type;
173
+ export {};
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Any = void 0;
4
+ const runtime_1 = require("@protobuf-ts/runtime");
5
+ const runtime_2 = require("@protobuf-ts/runtime");
6
+ const runtime_3 = require("@protobuf-ts/runtime");
7
+ const runtime_4 = require("@protobuf-ts/runtime");
8
+ const runtime_5 = require("@protobuf-ts/runtime");
9
+ const runtime_6 = require("@protobuf-ts/runtime");
10
+ const runtime_7 = require("@protobuf-ts/runtime");
11
+ const runtime_8 = require("@protobuf-ts/runtime");
12
+ // @generated message type with reflection information, may provide speed optimized methods
13
+ class Any$Type extends runtime_8.MessageType {
14
+ constructor() {
15
+ super("google.protobuf.Any", [
16
+ { no: 1, name: "type_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
17
+ { no: 2, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
18
+ ]);
19
+ }
20
+ /**
21
+ * Pack the message into a new `Any`.
22
+ *
23
+ * Uses 'type.googleapis.com/full.type.name' as the type URL.
24
+ */
25
+ pack(message, type) {
26
+ return {
27
+ typeUrl: this.typeNameToUrl(type.typeName), value: type.toBinary(message),
28
+ };
29
+ }
30
+ /**
31
+ * Unpack the message from the `Any`.
32
+ */
33
+ unpack(any, type, options) {
34
+ if (!this.contains(any, type))
35
+ throw new Error("Cannot unpack google.protobuf.Any with typeUrl '" + any.typeUrl + "' as " + type.typeName + ".");
36
+ return type.fromBinary(any.value, options);
37
+ }
38
+ /**
39
+ * Does the given `Any` contain a packed message of the given type?
40
+ */
41
+ contains(any, type) {
42
+ if (!any.typeUrl.length)
43
+ return false;
44
+ let wants = typeof type == "string" ? type : type.typeName;
45
+ let has = this.typeUrlToName(any.typeUrl);
46
+ return wants === has;
47
+ }
48
+ /**
49
+ * Convert the message to canonical JSON value.
50
+ *
51
+ * You have to provide the `typeRegistry` option so that the
52
+ * packed message can be converted to JSON.
53
+ *
54
+ * The `typeRegistry` option is also required to read
55
+ * `google.protobuf.Any` from JSON format.
56
+ */
57
+ internalJsonWrite(any, options) {
58
+ if (any.typeUrl === "")
59
+ return {};
60
+ let typeName = this.typeUrlToName(any.typeUrl);
61
+ let opt = (0, runtime_7.jsonWriteOptions)(options);
62
+ let type = opt.typeRegistry?.find(t => t.typeName === typeName);
63
+ if (!type)
64
+ throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '" + any.typeUrl + "' to JSON. The specified type " + typeName + " is not available in the type registry.");
65
+ let value = type.fromBinary(any.value, { readUnknownField: false });
66
+ let json = type.internalJsonWrite(value, opt);
67
+ if (typeName.startsWith("google.protobuf.") || !(0, runtime_5.isJsonObject)(json))
68
+ json = { value: json };
69
+ json["@type"] = any.typeUrl;
70
+ return json;
71
+ }
72
+ internalJsonRead(json, options, target) {
73
+ if (!(0, runtime_5.isJsonObject)(json))
74
+ throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON " + (0, runtime_6.typeofJsonValue)(json) + ".");
75
+ if (typeof json["@type"] != "string" || json["@type"] == "")
76
+ return this.create();
77
+ let typeName = this.typeUrlToName(json["@type"]);
78
+ let type = options?.typeRegistry?.find(t => t.typeName == typeName);
79
+ if (!type)
80
+ throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type " + typeName + " is not available in the type registry.");
81
+ let value;
82
+ if (typeName.startsWith("google.protobuf.") && json.hasOwnProperty("value"))
83
+ value = type.fromJson(json["value"], options);
84
+ else {
85
+ let copy = Object.assign({}, json);
86
+ delete copy["@type"];
87
+ value = type.fromJson(copy, options);
88
+ }
89
+ if (target === undefined)
90
+ target = this.create();
91
+ target.typeUrl = json["@type"];
92
+ target.value = type.toBinary(value);
93
+ return target;
94
+ }
95
+ typeNameToUrl(name) {
96
+ if (!name.length)
97
+ throw new Error("invalid type name: " + name);
98
+ return "type.googleapis.com/" + name;
99
+ }
100
+ typeUrlToName(url) {
101
+ if (!url.length)
102
+ throw new Error("invalid type url: " + url);
103
+ let slash = url.lastIndexOf("/");
104
+ let name = slash > 0 ? url.substring(slash + 1) : url;
105
+ if (!name.length)
106
+ throw new Error("invalid type url: " + url);
107
+ return name;
108
+ }
109
+ create(value) {
110
+ const message = { typeUrl: "", value: new Uint8Array(0) };
111
+ globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
112
+ if (value !== undefined)
113
+ (0, runtime_3.reflectionMergePartial)(this, message, value);
114
+ return message;
115
+ }
116
+ internalBinaryRead(reader, length, options, target) {
117
+ let message = target ?? this.create(), end = reader.pos + length;
118
+ while (reader.pos < end) {
119
+ let [fieldNo, wireType] = reader.tag();
120
+ switch (fieldNo) {
121
+ case /* string type_url */ 1:
122
+ message.typeUrl = reader.string();
123
+ break;
124
+ case /* bytes value */ 2:
125
+ message.value = reader.bytes();
126
+ break;
127
+ default:
128
+ let u = options.readUnknownField;
129
+ if (u === "throw")
130
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
131
+ let d = reader.skip(wireType);
132
+ if (u !== false)
133
+ (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
134
+ }
135
+ }
136
+ return message;
137
+ }
138
+ internalBinaryWrite(message, writer, options) {
139
+ /* string type_url = 1; */
140
+ if (message.typeUrl !== "")
141
+ writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.typeUrl);
142
+ /* bytes value = 2; */
143
+ if (message.value.length)
144
+ writer.tag(2, runtime_1.WireType.LengthDelimited).bytes(message.value);
145
+ let u = options.writeUnknownFields;
146
+ if (u !== false)
147
+ (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
148
+ return writer;
149
+ }
150
+ }
151
+ /**
152
+ * @generated MessageType for protobuf message google.protobuf.Any
153
+ */
154
+ exports.Any = new Any$Type();
155
+ //# sourceMappingURL=any.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"any.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/any.ts"],"names":[],"mappings":";;;AAoCA,kDAAgD;AAEhD,kDAA2D;AAE3D,kDAA8D;AAC9D,kDAAoD;AACpD,kDAAoD;AACpD,kDAAuD;AAEvD,kDAAwD;AAKxD,kDAAmD;AA8HnD,2FAA2F;AAC3F,MAAM,QAAS,SAAQ,qBAAgB;IACnC;QACI,KAAK,CAAC,qBAAqB,EAAE;YACzB,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,qBAAqB,EAAE;YACvE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,oBAAoB,EAAE;SACvE,CAAC,CAAC;IACP,CAAC;IACD;;;;OAIG;IACH,IAAI,CAAmB,OAAU,EAAE,IAAqB;QACpD,OAAO;YACH,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;SAC5E,CAAC;IACN,CAAC;IACD;;OAEG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AK;wBACX,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,6BAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;aACvG;SACJ;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,mBAAmB,CAAC,OAAY,EAAE,MAAqB,EAAE,OAA2B;QAChF,0BAA0B;QAC1B,IAAI,OAAO,CAAC,OAAO,KAAK,EAAE;YACtB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAQ,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpE,sBAAsB;QACtB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM;YACpB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAQ,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACjE,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACnC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,6BAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AACD;;GAEG;AACU,QAAA,GAAG,GAAG,IAAI,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ /**
8
+ * A generic empty message that you can re-use to avoid defining duplicated
9
+ * empty messages in your APIs. A typical example is to use it as the request
10
+ * or the response type of an API method. For instance:
11
+ *
12
+ * service Foo {
13
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
14
+ * }
15
+ *
16
+ * The JSON representation for `Empty` is empty JSON object `{}`.
17
+ *
18
+ * @generated from protobuf message google.protobuf.Empty
19
+ */
20
+ export interface Empty {
21
+ }
22
+ declare class Empty$Type extends MessageType<Empty> {
23
+ constructor();
24
+ create(value?: PartialMessage<Empty>): Empty;
25
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty;
26
+ internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
27
+ }
28
+ /**
29
+ * @generated MessageType for protobuf message google.protobuf.Empty
30
+ */
31
+ export declare const Empty: Empty$Type;
32
+ export {};
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Empty = void 0;
4
+ const runtime_1 = require("@protobuf-ts/runtime");
5
+ const runtime_2 = require("@protobuf-ts/runtime");
6
+ const runtime_3 = require("@protobuf-ts/runtime");
7
+ const runtime_4 = require("@protobuf-ts/runtime");
8
+ // @generated message type with reflection information, may provide speed optimized methods
9
+ class Empty$Type extends runtime_4.MessageType {
10
+ constructor() {
11
+ super("google.protobuf.Empty", []);
12
+ }
13
+ create(value) {
14
+ const message = {};
15
+ globalThis.Object.defineProperty(message, runtime_3.MESSAGE_TYPE, { enumerable: false, value: this });
16
+ if (value !== undefined)
17
+ (0, runtime_2.reflectionMergePartial)(this, message, value);
18
+ return message;
19
+ }
20
+ internalBinaryRead(reader, length, options, target) {
21
+ return target ?? this.create();
22
+ }
23
+ internalBinaryWrite(message, writer, options) {
24
+ let u = options.writeUnknownFields;
25
+ if (u !== false)
26
+ (u == true ? runtime_1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
27
+ return writer;
28
+ }
29
+ }
30
+ /**
31
+ * @generated MessageType for protobuf message google.protobuf.Empty
32
+ */
33
+ exports.Empty = new Empty$Type();
34
+ //# sourceMappingURL=empty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../../../src/proto/google/protobuf/empty.ts"],"names":[],"mappings":";;;AAoCA,kDAA2D;AAI3D,kDAA8D;AAC9D,kDAAoD;AACpD,kDAAmD;AAgBnD,2FAA2F;AAC3F,MAAM,UAAW,SAAQ,qBAAkB;IACvC;QACI,KAAK,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,MAAM,CAAC,KAA6B;QAChC,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAY,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5F,IAAI,KAAK,KAAK,SAAS;YACnB,IAAA,gCAAsB,EAAQ,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,kBAAkB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAA0B,EAAE,MAAc;QAChG,OAAO,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;IACnC,CAAC;IACD,mBAAmB,CAAC,OAAc,EAAE,MAAqB,EAAE,OAA2B;QAClF,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACnC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,6BAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AACD;;GAEG;AACU,QAAA,KAAK,GAAG,IAAI,UAAU,EAAE,CAAC"}
@@ -0,0 +1,149 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import type { JsonValue } from "@protobuf-ts/runtime";
7
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
8
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
9
+ import { MessageType } from "@protobuf-ts/runtime";
10
+ /**
11
+ * A Timestamp represents a point in time independent of any time zone or local
12
+ * calendar, encoded as a count of seconds and fractions of seconds at
13
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
14
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
15
+ * Gregorian calendar backwards to year one.
16
+ *
17
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
18
+ * second table is needed for interpretation, using a [24-hour linear
19
+ * smear](https://developers.google.com/time/smear).
20
+ *
21
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
22
+ * restricting to that range, we ensure that we can convert to and from [RFC
23
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
24
+ *
25
+ * # Examples
26
+ *
27
+ * Example 1: Compute Timestamp from POSIX `time()`.
28
+ *
29
+ * Timestamp timestamp;
30
+ * timestamp.set_seconds(time(NULL));
31
+ * timestamp.set_nanos(0);
32
+ *
33
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
34
+ *
35
+ * struct timeval tv;
36
+ * gettimeofday(&tv, NULL);
37
+ *
38
+ * Timestamp timestamp;
39
+ * timestamp.set_seconds(tv.tv_sec);
40
+ * timestamp.set_nanos(tv.tv_usec * 1000);
41
+ *
42
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
43
+ *
44
+ * FILETIME ft;
45
+ * GetSystemTimeAsFileTime(&ft);
46
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
47
+ *
48
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
49
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
50
+ * Timestamp timestamp;
51
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
52
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
53
+ *
54
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
55
+ *
56
+ * long millis = System.currentTimeMillis();
57
+ *
58
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
59
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
60
+ *
61
+ *
62
+ * Example 5: Compute Timestamp from current time in Python.
63
+ *
64
+ * timestamp = Timestamp()
65
+ * timestamp.GetCurrentTime()
66
+ *
67
+ * # JSON Mapping
68
+ *
69
+ * In JSON format, the Timestamp type is encoded as a string in the
70
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
71
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
72
+ * where {year} is always expressed using four digits while {month}, {day},
73
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
74
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
75
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
76
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
77
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
78
+ * able to accept both UTC and other timezones (as indicated by an offset).
79
+ *
80
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
81
+ * 01:30 UTC on January 15, 2017.
82
+ *
83
+ * In JavaScript, one can convert a Date object to this format using the
84
+ * standard
85
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
86
+ * method. In Python, a standard `datetime.datetime` object can be converted
87
+ * to this format using
88
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
89
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
90
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
91
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
92
+ * ) to obtain a formatter capable of generating timestamps in this format.
93
+ *
94
+ *
95
+ *
96
+ * @generated from protobuf message google.protobuf.Timestamp
97
+ */
98
+ export interface Timestamp {
99
+ /**
100
+ * Represents seconds of UTC time since Unix epoch
101
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
102
+ * 9999-12-31T23:59:59Z inclusive.
103
+ *
104
+ * @generated from protobuf field: int64 seconds = 1;
105
+ */
106
+ seconds: number;
107
+ /**
108
+ * Non-negative fractions of a second at nanosecond resolution. Negative
109
+ * second values with fractions must still have non-negative nanos values
110
+ * that count forward in time. Must be from 0 to 999,999,999
111
+ * inclusive.
112
+ *
113
+ * @generated from protobuf field: int32 nanos = 2;
114
+ */
115
+ nanos: number;
116
+ }
117
+ declare class Timestamp$Type extends MessageType<Timestamp> {
118
+ constructor();
119
+ /**
120
+ * Creates a new `Timestamp` for the current time.
121
+ */
122
+ now(): Timestamp;
123
+ /**
124
+ * Converts a `Timestamp` to a JavaScript Date.
125
+ */
126
+ toDate(message: Timestamp): Date;
127
+ /**
128
+ * Converts a JavaScript Date to a `Timestamp`.
129
+ */
130
+ fromDate(date: Date): Timestamp;
131
+ /**
132
+ * In JSON format, the `Timestamp` type is encoded as a string
133
+ * in the RFC 3339 format.
134
+ */
135
+ internalJsonWrite(message: Timestamp, options: JsonWriteOptions): JsonValue;
136
+ /**
137
+ * In JSON format, the `Timestamp` type is encoded as a string
138
+ * in the RFC 3339 format.
139
+ */
140
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Timestamp): Timestamp;
141
+ create(value?: PartialMessage<Timestamp>): Timestamp;
142
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Timestamp): Timestamp;
143
+ internalBinaryWrite(message: Timestamp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
144
+ }
145
+ /**
146
+ * @generated MessageType for protobuf message google.protobuf.Timestamp
147
+ */
148
+ export declare const Timestamp: Timestamp$Type;
149
+ export {};