@raystack/proton 0.1.0-8a4f578dceca476c696c82054faaf4871b1b949c → 0.1.0-8cb19702a3e47d173732860d58084b83d6941865

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 (198) hide show
  1. package/google/api/annotations_pb.ts +15 -9
  2. package/google/api/field_behavior_pb.ts +19 -19
  3. package/google/api/http_pb.ts +43 -108
  4. package/google/api/httpbody_pb.ts +23 -37
  5. package/index.ts +10 -0
  6. package/package.json +61 -17
  7. package/protoc-gen-openapiv2/options/annotations_pb.ts +23 -29
  8. package/protoc-gen-openapiv2/options/openapiv2_pb.ts +338 -808
  9. package/raystack/assets/index.ts +29 -29
  10. package/raystack/assets/v1beta1/bucket_pb.ts +46 -89
  11. package/raystack/assets/v1beta1/dashboard_pb.ts +49 -97
  12. package/raystack/assets/v1beta1/event_pb.ts +22 -36
  13. package/raystack/assets/v1beta1/group_pb.ts +38 -74
  14. package/raystack/assets/v1beta1/job_pb.ts +30 -43
  15. package/raystack/assets/v1beta1/lineage_pb.ts +22 -36
  16. package/raystack/assets/v1beta1/ownership_pb.ts +31 -68
  17. package/raystack/assets/v1beta1/preview_pb.ts +21 -34
  18. package/raystack/assets/v1beta1/properties_pb.ts +22 -37
  19. package/raystack/assets/v1beta1/resource_pb.ts +24 -43
  20. package/raystack/assets/v1beta1/schema_pb.ts +59 -145
  21. package/raystack/assets/v1beta1/table_pb.ts +59 -120
  22. package/raystack/assets/v1beta1/timestamp_pb.ts +28 -62
  23. package/raystack/assets/v1beta1/topic_pb.ts +43 -78
  24. package/raystack/assets/v1beta1/user_pb.ts +58 -125
  25. package/raystack/assets/v1beta2/application_pb.ts +23 -39
  26. package/raystack/assets/v1beta2/asset_pb.ts +30 -53
  27. package/raystack/assets/v1beta2/bucket_pb.ts +41 -87
  28. package/raystack/assets/v1beta2/common_pb.ts +56 -137
  29. package/raystack/assets/v1beta2/dashboard_pb.ts +44 -93
  30. package/raystack/assets/v1beta2/experiment_pb.ts +38 -79
  31. package/raystack/assets/v1beta2/feature_table_pb.ts +51 -115
  32. package/raystack/assets/v1beta2/group_pb.ts +32 -68
  33. package/raystack/assets/v1beta2/job_pb.ts +21 -35
  34. package/raystack/assets/v1beta2/metric_pb.ts +25 -43
  35. package/raystack/assets/v1beta2/model_pb.ts +59 -147
  36. package/raystack/assets/v1beta2/table_pb.ts +82 -200
  37. package/raystack/assets/v1beta2/topic_pb.ts +41 -99
  38. package/raystack/assets/v1beta2/user_pb.ts +53 -121
  39. package/raystack/common/index.ts +1 -2
  40. package/raystack/common/v1/service-CommonService_connectquery.ts +3 -14
  41. package/raystack/common/v1/service_pb.ts +57 -97
  42. package/raystack/compass/index.ts +1 -2
  43. package/raystack/compass/v1beta1/service-CompassService_connectquery.ts +44 -424
  44. package/raystack/compass/v1beta1/service_pb.ts +1448 -3319
  45. package/raystack/entropy/index.ts +2 -4
  46. package/raystack/entropy/v1beta1/module-ModuleService_connectquery.ts +7 -54
  47. package/raystack/entropy/v1beta1/module_pb.ts +156 -324
  48. package/raystack/entropy/v1beta1/resource-ResourceService_connectquery.ts +9 -74
  49. package/raystack/entropy/v1beta1/resource_pb.ts +330 -756
  50. package/raystack/frontier/index.ts +3 -5
  51. package/raystack/frontier/v1beta1/admin-AdminService_connectquery.ts +60 -514
  52. package/raystack/frontier/v1beta1/admin_pb.ts +1774 -3791
  53. package/raystack/frontier/v1beta1/frontier-FrontierService_connectquery.ts +169 -1674
  54. package/raystack/frontier/v1beta1/frontier_pb.ts +4850 -10959
  55. package/raystack/frontier/v1beta1/models_pb.ts +810 -2296
  56. package/raystack/guardian/index.ts +1 -2
  57. package/raystack/guardian/v1beta1/guardian-GuardianService_connectquery.ts +42 -404
  58. package/raystack/guardian/v1beta1/guardian_pb.ts +1584 -3783
  59. package/raystack/optimus/core/v1beta1/backup-BackupService_connectquery.ts +5 -34
  60. package/raystack/optimus/core/v1beta1/backup_pb.ts +137 -273
  61. package/raystack/optimus/core/v1beta1/job_run-JobRunService_connectquery.ts +6 -44
  62. package/raystack/optimus/core/v1beta1/job_run_pb.ts +194 -376
  63. package/raystack/optimus/core/v1beta1/job_spec-JobSpecificationService_connectquery.ts +17 -154
  64. package/raystack/optimus/core/v1beta1/job_spec_pb.ts +910 -2081
  65. package/raystack/optimus/core/v1beta1/namespace-NamespaceService_connectquery.ts +5 -34
  66. package/raystack/optimus/core/v1beta1/namespace_pb.ts +113 -212
  67. package/raystack/optimus/core/v1beta1/project-ProjectService_connectquery.ts +5 -34
  68. package/raystack/optimus/core/v1beta1/project_pb.ts +121 -238
  69. package/raystack/optimus/core/v1beta1/replay-ReplayService_connectquery.ts +6 -44
  70. package/raystack/optimus/core/v1beta1/replay_pb.ts +160 -335
  71. package/raystack/optimus/core/v1beta1/resource-ResourceService_connectquery.ts +8 -64
  72. package/raystack/optimus/core/v1beta1/resource_pb.ts +266 -527
  73. package/raystack/optimus/core/v1beta1/runtime-RuntimeService_connectquery.ts +3 -14
  74. package/raystack/optimus/core/v1beta1/runtime_pb.ts +48 -61
  75. package/raystack/optimus/core/v1beta1/secret-SecretService_connectquery.ts +6 -44
  76. package/raystack/optimus/core/v1beta1/secret_pb.ts +155 -283
  77. package/raystack/optimus/core/v1beta1/status_pb.ts +35 -54
  78. package/raystack/optimus/integration/v1beta1/event_pb.ts +75 -187
  79. package/raystack/optimus/plugins/v1beta1/dependency_resolver-DependencyResolverModService_connectquery.ts +6 -44
  80. package/raystack/optimus/plugins/v1beta1/dependency_resolver_pb.ts +193 -426
  81. package/raystack/predator/index.ts +2 -2
  82. package/raystack/predator/v1beta1/metrics_log_pb.ts +67 -173
  83. package/raystack/predator/v1beta1/result_log_pb.ts +60 -144
  84. package/raystack/raccoon/index.ts +1 -2
  85. package/raystack/raccoon/v1beta1/raccoon-EventService_connectquery.ts +3 -14
  86. package/raystack/raccoon/v1beta1/raccoon_pb.ts +142 -189
  87. package/raystack/siren/index.ts +1 -2
  88. package/raystack/siren/v1beta1/siren-SirenService_connectquery.ts +37 -354
  89. package/raystack/siren/v1beta1/siren_pb.ts +1155 -2637
  90. package/raystack/stencil/index.ts +1 -2
  91. package/raystack/stencil/v1beta1/stencil-StencilService_connectquery.ts +18 -164
  92. package/raystack/stencil/v1beta1/stencil_pb.ts +530 -1157
  93. package/validate/validate_pb.ts +401 -1038
  94. package/google/api/field_behavior.ts +0 -95
  95. package/google/api/http.ts +0 -695
  96. package/google/api/httpbody.ts +0 -159
  97. package/google/protobuf/any.ts +0 -322
  98. package/google/protobuf/descriptor.ts +0 -3475
  99. package/google/protobuf/duration.ts +0 -231
  100. package/google/protobuf/struct.ts +0 -484
  101. package/google/protobuf/timestamp.ts +0 -290
  102. package/google/protobuf/wrappers.ts +0 -752
  103. package/protoc-gen-openapiv2/options/openapiv2.ts +0 -3110
  104. package/raystack/assets/v1beta1/bucket.ts +0 -362
  105. package/raystack/assets/v1beta1/dashboard.ts +0 -426
  106. package/raystack/assets/v1beta1/event.ts +0 -105
  107. package/raystack/assets/v1beta1/group.ts +0 -223
  108. package/raystack/assets/v1beta1/job.ts +0 -147
  109. package/raystack/assets/v1beta1/lineage.ts +0 -90
  110. package/raystack/assets/v1beta1/ownership.ts +0 -179
  111. package/raystack/assets/v1beta1/preview.ts +0 -87
  112. package/raystack/assets/v1beta1/properties.ts +0 -116
  113. package/raystack/assets/v1beta1/resource.ts +0 -149
  114. package/raystack/assets/v1beta1/schema.ts +0 -421
  115. package/raystack/assets/v1beta1/table.ts +0 -408
  116. package/raystack/assets/v1beta1/timestamp.ts +0 -158
  117. package/raystack/assets/v1beta1/topic.ts +0 -253
  118. package/raystack/assets/v1beta1/user.ts +0 -451
  119. package/raystack/assets/v1beta2/application.ts +0 -125
  120. package/raystack/assets/v1beta2/asset.ts +0 -269
  121. package/raystack/assets/v1beta2/bucket.ts +0 -341
  122. package/raystack/assets/v1beta2/common.ts +0 -392
  123. package/raystack/assets/v1beta2/dashboard.ts +0 -393
  124. package/raystack/assets/v1beta2/experiment.ts +0 -274
  125. package/raystack/assets/v1beta2/feature_table.ts +0 -387
  126. package/raystack/assets/v1beta2/group.ts +0 -178
  127. package/raystack/assets/v1beta2/job.ts +0 -99
  128. package/raystack/assets/v1beta2/metric.ts +0 -163
  129. package/raystack/assets/v1beta2/model.ts +0 -519
  130. package/raystack/assets/v1beta2/table.ts +0 -663
  131. package/raystack/assets/v1beta2/topic.ts +0 -275
  132. package/raystack/assets/v1beta2/user.ts +0 -433
  133. package/raystack/common/v1/service.client.ts +0 -37
  134. package/raystack/common/v1/service.ts +0 -245
  135. package/raystack/common/v1/service_connect.ts +0 -26
  136. package/raystack/compass/v1beta1/service.client.ts +0 -594
  137. package/raystack/compass/v1beta1/service.ts +0 -8169
  138. package/raystack/compass/v1beta1/service_connect.ts +0 -407
  139. package/raystack/entropy/v1beta1/module.client.ts +0 -89
  140. package/raystack/entropy/v1beta1/module.ts +0 -692
  141. package/raystack/entropy/v1beta1/module_connect.ts +0 -62
  142. package/raystack/entropy/v1beta1/resource.client.ts +0 -129
  143. package/raystack/entropy/v1beta1/resource.ts +0 -1817
  144. package/raystack/entropy/v1beta1/resource_connect.ts +0 -89
  145. package/raystack/frontier/v1beta1/admin.client.ts +0 -849
  146. package/raystack/frontier/v1beta1/admin.ts +0 -9007
  147. package/raystack/frontier/v1beta1/admin_connect.ts +0 -573
  148. package/raystack/frontier/v1beta1/frontier.client.ts +0 -2307
  149. package/raystack/frontier/v1beta1/frontier.ts +0 -23706
  150. package/raystack/frontier/v1beta1/frontier_connect.ts +0 -1574
  151. package/raystack/frontier/v1beta1/models.ts +0 -7433
  152. package/raystack/guardian/v1beta1/guardian.client.ts +0 -552
  153. package/raystack/guardian/v1beta1/guardian.ts +0 -9688
  154. package/raystack/guardian/v1beta1/guardian_connect.ts +0 -381
  155. package/raystack/optimus/core/v1beta1/backup.client.ts +0 -63
  156. package/raystack/optimus/core/v1beta1/backup.ts +0 -708
  157. package/raystack/optimus/core/v1beta1/backup_connect.ts +0 -44
  158. package/raystack/optimus/core/v1beta1/job_run.client.ts +0 -96
  159. package/raystack/optimus/core/v1beta1/job_run.ts +0 -1008
  160. package/raystack/optimus/core/v1beta1/job_run_connect.ts +0 -63
  161. package/raystack/optimus/core/v1beta1/job_spec.client.ts +0 -363
  162. package/raystack/optimus/core/v1beta1/job_spec.ts +0 -5134
  163. package/raystack/optimus/core/v1beta1/job_spec_connect.ts +0 -233
  164. package/raystack/optimus/core/v1beta1/namespace.client.ts +0 -75
  165. package/raystack/optimus/core/v1beta1/namespace.ts +0 -477
  166. package/raystack/optimus/core/v1beta1/namespace_connect.ts +0 -50
  167. package/raystack/optimus/core/v1beta1/project.client.ts +0 -75
  168. package/raystack/optimus/core/v1beta1/project.ts +0 -520
  169. package/raystack/optimus/core/v1beta1/project_connect.ts +0 -50
  170. package/raystack/optimus/core/v1beta1/replay.client.ts +0 -76
  171. package/raystack/optimus/core/v1beta1/replay.ts +0 -881
  172. package/raystack/optimus/core/v1beta1/replay_connect.ts +0 -53
  173. package/raystack/optimus/core/v1beta1/resource.client.ts +0 -148
  174. package/raystack/optimus/core/v1beta1/resource.ts +0 -1329
  175. package/raystack/optimus/core/v1beta1/resource_connect.ts +0 -96
  176. package/raystack/optimus/core/v1beta1/runtime.client.ts +0 -45
  177. package/raystack/optimus/core/v1beta1/runtime.ts +0 -131
  178. package/raystack/optimus/core/v1beta1/runtime_connect.ts +0 -30
  179. package/raystack/optimus/core/v1beta1/secret.client.ts +0 -92
  180. package/raystack/optimus/core/v1beta1/secret.ts +0 -619
  181. package/raystack/optimus/core/v1beta1/secret_connect.ts +0 -61
  182. package/raystack/optimus/core/v1beta1/status.ts +0 -113
  183. package/raystack/optimus/integration/v1beta1/event.ts +0 -531
  184. package/raystack/optimus/plugins/v1beta1/dependency_resolver.client.ts +0 -100
  185. package/raystack/optimus/plugins/v1beta1/dependency_resolver.ts +0 -950
  186. package/raystack/optimus/plugins/v1beta1/dependency_resolver_connect.ts +0 -65
  187. package/raystack/predator/v1beta1/metrics_log.ts +0 -457
  188. package/raystack/predator/v1beta1/result_log.ts +0 -390
  189. package/raystack/raccoon/v1beta1/raccoon.client.ts +0 -37
  190. package/raystack/raccoon/v1beta1/raccoon.ts +0 -442
  191. package/raystack/raccoon/v1beta1/raccoon_connect.ts +0 -26
  192. package/raystack/siren/v1beta1/siren.client.ts +0 -479
  193. package/raystack/siren/v1beta1/siren.ts +0 -6507
  194. package/raystack/siren/v1beta1/siren_connect.ts +0 -332
  195. package/raystack/stencil/v1beta1/stencil.client.ts +0 -232
  196. package/raystack/stencil/v1beta1/stencil.ts +0 -2716
  197. package/raystack/stencil/v1beta1/stencil_connect.ts +0 -161
  198. package/validate/validate.ts +0 -4130
@@ -1,290 +0,0 @@
1
- // @generated by protobuf-ts 2.11.1
2
- // @generated from protobuf file "google/protobuf/timestamp.proto" (package "google.protobuf", syntax proto3)
3
- // tslint:disable
4
- //
5
- // Protocol Buffers - Google's data interchange format
6
- // Copyright 2008 Google Inc. All rights reserved.
7
- // https://developers.google.com/protocol-buffers/
8
- //
9
- // Redistribution and use in source and binary forms, with or without
10
- // modification, are permitted provided that the following conditions are
11
- // met:
12
- //
13
- // * Redistributions of source code must retain the above copyright
14
- // notice, this list of conditions and the following disclaimer.
15
- // * Redistributions in binary form must reproduce the above
16
- // copyright notice, this list of conditions and the following disclaimer
17
- // in the documentation and/or other materials provided with the
18
- // distribution.
19
- // * Neither the name of Google Inc. nor the names of its
20
- // contributors may be used to endorse or promote products derived from
21
- // this software without specific prior written permission.
22
- //
23
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
- //
35
- import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
36
- import type { IBinaryWriter } from "@protobuf-ts/runtime";
37
- import { WireType } from "@protobuf-ts/runtime";
38
- import type { BinaryReadOptions } from "@protobuf-ts/runtime";
39
- import type { IBinaryReader } from "@protobuf-ts/runtime";
40
- import { UnknownFieldHandler } from "@protobuf-ts/runtime";
41
- import type { PartialMessage } from "@protobuf-ts/runtime";
42
- import { reflectionMergePartial } from "@protobuf-ts/runtime";
43
- import { typeofJsonValue } from "@protobuf-ts/runtime";
44
- import type { JsonValue } from "@protobuf-ts/runtime";
45
- import type { JsonReadOptions } from "@protobuf-ts/runtime";
46
- import type { JsonWriteOptions } from "@protobuf-ts/runtime";
47
- import { PbLong } from "@protobuf-ts/runtime";
48
- import { MessageType } from "@protobuf-ts/runtime";
49
- /**
50
- * A Timestamp represents a point in time independent of any time zone or local
51
- * calendar, encoded as a count of seconds and fractions of seconds at
52
- * nanosecond resolution. The count is relative to an epoch at UTC midnight on
53
- * January 1, 1970, in the proleptic Gregorian calendar which extends the
54
- * Gregorian calendar backwards to year one.
55
- *
56
- * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
57
- * second table is needed for interpretation, using a [24-hour linear
58
- * smear](https://developers.google.com/time/smear).
59
- *
60
- * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
61
- * restricting to that range, we ensure that we can convert to and from [RFC
62
- * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
63
- *
64
- * # Examples
65
- *
66
- * Example 1: Compute Timestamp from POSIX `time()`.
67
- *
68
- * Timestamp timestamp;
69
- * timestamp.set_seconds(time(NULL));
70
- * timestamp.set_nanos(0);
71
- *
72
- * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
73
- *
74
- * struct timeval tv;
75
- * gettimeofday(&tv, NULL);
76
- *
77
- * Timestamp timestamp;
78
- * timestamp.set_seconds(tv.tv_sec);
79
- * timestamp.set_nanos(tv.tv_usec * 1000);
80
- *
81
- * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
82
- *
83
- * FILETIME ft;
84
- * GetSystemTimeAsFileTime(&ft);
85
- * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
86
- *
87
- * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
88
- * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
89
- * Timestamp timestamp;
90
- * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
91
- * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
92
- *
93
- * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
94
- *
95
- * long millis = System.currentTimeMillis();
96
- *
97
- * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
98
- * .setNanos((int) ((millis % 1000) * 1000000)).build();
99
- *
100
- *
101
- * Example 5: Compute Timestamp from Java `Instant.now()`.
102
- *
103
- * Instant now = Instant.now();
104
- *
105
- * Timestamp timestamp =
106
- * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
107
- * .setNanos(now.getNano()).build();
108
- *
109
- *
110
- * Example 6: Compute Timestamp from current time in Python.
111
- *
112
- * timestamp = Timestamp()
113
- * timestamp.GetCurrentTime()
114
- *
115
- * # JSON Mapping
116
- *
117
- * In JSON format, the Timestamp type is encoded as a string in the
118
- * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
119
- * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
120
- * where {year} is always expressed using four digits while {month}, {day},
121
- * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
122
- * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
123
- * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
124
- * is required. A proto3 JSON serializer should always use UTC (as indicated by
125
- * "Z") when printing the Timestamp type and a proto3 JSON parser should be
126
- * able to accept both UTC and other timezones (as indicated by an offset).
127
- *
128
- * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
129
- * 01:30 UTC on January 15, 2017.
130
- *
131
- * In JavaScript, one can convert a Date object to this format using the
132
- * standard
133
- * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
134
- * method. In Python, a standard `datetime.datetime` object can be converted
135
- * to this format using
136
- * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
137
- * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
138
- * the Joda Time's [`ISODateTimeFormat.dateTime()`](
139
- * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
140
- * ) to obtain a formatter capable of generating timestamps in this format.
141
- *
142
- *
143
- *
144
- * @generated from protobuf message google.protobuf.Timestamp
145
- */
146
- export interface Timestamp {
147
- /**
148
- * Represents seconds of UTC time since Unix epoch
149
- * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
150
- * 9999-12-31T23:59:59Z inclusive.
151
- *
152
- * @generated from protobuf field: int64 seconds = 1
153
- */
154
- seconds: bigint;
155
- /**
156
- * Non-negative fractions of a second at nanosecond resolution. Negative
157
- * second values with fractions must still have non-negative nanos values
158
- * that count forward in time. Must be from 0 to 999,999,999
159
- * inclusive.
160
- *
161
- * @generated from protobuf field: int32 nanos = 2
162
- */
163
- nanos: number;
164
- }
165
- // @generated message type with reflection information, may provide speed optimized methods
166
- class Timestamp$Type extends MessageType<Timestamp> {
167
- constructor() {
168
- super("google.protobuf.Timestamp", [
169
- { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
170
- { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
171
- ]);
172
- }
173
- /**
174
- * Creates a new `Timestamp` for the current time.
175
- */
176
- now(): Timestamp {
177
- const msg = this.create();
178
- const ms = Date.now();
179
- msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
180
- msg.nanos = (ms % 1000) * 1000000;
181
- return msg;
182
- }
183
- /**
184
- * Converts a `Timestamp` to a JavaScript Date.
185
- */
186
- toDate(message: Timestamp): Date {
187
- return new Date(PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000));
188
- }
189
- /**
190
- * Converts a JavaScript Date to a `Timestamp`.
191
- */
192
- fromDate(date: Date): Timestamp {
193
- const msg = this.create();
194
- const ms = date.getTime();
195
- msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
196
- msg.nanos = ((ms % 1000) + (ms < 0 && ms % 1000 !== 0 ? 1000 : 0)) * 1000000;
197
- return msg;
198
- }
199
- /**
200
- * In JSON format, the `Timestamp` type is encoded as a string
201
- * in the RFC 3339 format.
202
- */
203
- internalJsonWrite(message: Timestamp, options: JsonWriteOptions): JsonValue {
204
- let ms = PbLong.from(message.seconds).toNumber() * 1000;
205
- if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
206
- throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
207
- if (message.nanos < 0)
208
- throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");
209
- let z = "Z";
210
- if (message.nanos > 0) {
211
- let nanosStr = (message.nanos + 1000000000).toString().substring(1);
212
- if (nanosStr.substring(3) === "000000")
213
- z = "." + nanosStr.substring(0, 3) + "Z";
214
- else if (nanosStr.substring(6) === "000")
215
- z = "." + nanosStr.substring(0, 6) + "Z";
216
- else
217
- z = "." + nanosStr + "Z";
218
- }
219
- return new Date(ms).toISOString().replace(".000Z", z);
220
- }
221
- /**
222
- * In JSON format, the `Timestamp` type is encoded as a string
223
- * in the RFC 3339 format.
224
- */
225
- internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Timestamp): Timestamp {
226
- if (typeof json !== "string")
227
- throw new Error("Unable to parse Timestamp from JSON " + typeofJsonValue(json) + ".");
228
- 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]))$/);
229
- if (!matches)
230
- throw new Error("Unable to parse Timestamp from JSON. Invalid format.");
231
- let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z"));
232
- if (Number.isNaN(ms))
233
- throw new Error("Unable to parse Timestamp from JSON. Invalid value.");
234
- if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
235
- 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.");
236
- if (!target)
237
- target = this.create();
238
- target.seconds = PbLong.from(ms / 1000).toBigInt();
239
- target.nanos = 0;
240
- if (matches[7])
241
- target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
242
- return target;
243
- }
244
- create(value?: PartialMessage<Timestamp>): Timestamp {
245
- const message = globalThis.Object.create((this.messagePrototype!));
246
- message.seconds = 0n;
247
- message.nanos = 0;
248
- if (value !== undefined)
249
- reflectionMergePartial<Timestamp>(this, message, value);
250
- return message;
251
- }
252
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Timestamp): Timestamp {
253
- let message = target ?? this.create(), end = reader.pos + length;
254
- while (reader.pos < end) {
255
- let [fieldNo, wireType] = reader.tag();
256
- switch (fieldNo) {
257
- case /* int64 seconds */ 1:
258
- message.seconds = reader.int64().toBigInt();
259
- break;
260
- case /* int32 nanos */ 2:
261
- message.nanos = reader.int32();
262
- break;
263
- default:
264
- let u = options.readUnknownField;
265
- if (u === "throw")
266
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
267
- let d = reader.skip(wireType);
268
- if (u !== false)
269
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
270
- }
271
- }
272
- return message;
273
- }
274
- internalBinaryWrite(message: Timestamp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
275
- /* int64 seconds = 1; */
276
- if (message.seconds !== 0n)
277
- writer.tag(1, WireType.Varint).int64(message.seconds);
278
- /* int32 nanos = 2; */
279
- if (message.nanos !== 0)
280
- writer.tag(2, WireType.Varint).int32(message.nanos);
281
- let u = options.writeUnknownFields;
282
- if (u !== false)
283
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
284
- return writer;
285
- }
286
- }
287
- /**
288
- * @generated MessageType for protobuf message google.protobuf.Timestamp
289
- */
290
- export const Timestamp = new Timestamp$Type();