@structured-id/ui-core 1.3.0 → 3.0.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 (152) hide show
  1. package/README.md +22 -10
  2. package/package.json +25 -43
  3. package/src/components/SidStatusBadge.vue +1 -5
  4. package/src/composables/useAccountTransport.test.ts +2 -1
  5. package/src/composables/useGrpc.test.ts +17 -14
  6. package/src/composables/useGrpc.ts +4 -2
  7. package/src/index.ts +2 -120
  8. package/src/profile/components/ConsentManager.vue +5 -1
  9. package/src/profile/components/ProfileEditor.vue +1 -1
  10. package/src/profile/components/SecuritySettings.vue +5 -1
  11. package/src/profile/components/SessionList.vue +2 -1
  12. package/src/profile/components/SidRegistrationForm.test.ts +173 -1
  13. package/src/profile/components/SidRegistrationForm.vue +88 -32
  14. package/src/profile/components/index.ts +1 -4
  15. package/src/profile/composables/index.ts +1 -0
  16. package/src/profile/composables/operationPlan.test.ts +155 -0
  17. package/src/profile/composables/operationPlan.ts +218 -0
  18. package/src/profile/composables/useAccountApi.ts +4 -4
  19. package/src/profile/composables/useAuth.test.ts +312 -31
  20. package/src/profile/composables/useAuth.ts +176 -30
  21. package/src/profile/composables/useAuthApi.opaque.test.ts +13 -6
  22. package/src/profile/composables/useAuthApi.ts +40 -18
  23. package/src/profile/composables/useCurrentPasswordRequirement.test.ts +196 -0
  24. package/src/profile/composables/useCurrentPasswordRequirement.ts +95 -0
  25. package/src/profile/composables/useEnrollmentApi.test.ts +7 -3
  26. package/src/profile/composables/useEnrollmentApi.ts +3 -5
  27. package/src/profile/composables/useIdentityApi.ts +4 -4
  28. package/src/profile/composables/useSecurityLevel.test.ts +1 -1
  29. package/src/profile/composables/useSecurityLevel.ts +1 -1
  30. package/src/quasar/SidPasswordCeremony.test.ts +253 -0
  31. package/src/quasar/SidPasswordCeremony.vue +456 -0
  32. package/src/quasar/index.ts +2 -0
  33. package/src/utils/rpcRefusal.test.ts +4 -4
  34. package/src/utils/rpcRefusal.ts +8 -4
  35. package/dist/browser-vp/index.cjs +0 -349
  36. package/dist/browser-vp/index.d.cts +0 -276
  37. package/dist/browser-vp/index.d.ts +0 -276
  38. package/dist/browser-vp/index.js +0 -349
  39. package/dist/chunk-C3Q766CY.cjs +0 -125
  40. package/dist/chunk-J5YXRXB5.js +0 -125
  41. package/dist/index.cjs +0 -23581
  42. package/dist/index.d.cts +0 -11539
  43. package/dist/index.d.ts +0 -11539
  44. package/dist/index.js +0 -23581
  45. package/dist/storage-4CB2JTLW.cjs +0 -22
  46. package/dist/storage-THRWREZP.js +0 -22
  47. package/src/browser-vp/crypto.ts +0 -253
  48. package/src/browser-vp/index.test.ts +0 -10
  49. package/src/browser-vp/index.ts +0 -116
  50. package/src/browser-vp/prf.ts +0 -179
  51. package/src/browser-vp/storage.test.ts +0 -9
  52. package/src/browser-vp/storage.ts +0 -163
  53. package/src/browser-vp/types.ts +0 -95
  54. package/src/browser-vp/vp.test.ts +0 -43
  55. package/src/browser-vp/vp.ts +0 -111
  56. package/src/generated/google/api/http.ts +0 -687
  57. package/src/generated/google/api/httpbody.ts +0 -159
  58. package/src/generated/google/protobuf/any.ts +0 -326
  59. package/src/generated/google/protobuf/descriptor.ts +0 -4865
  60. package/src/generated/google/protobuf/duration.ts +0 -230
  61. package/src/generated/google/protobuf/empty.ts +0 -94
  62. package/src/generated/google/protobuf/struct.ts +0 -484
  63. package/src/generated/google/protobuf/timestamp.ts +0 -287
  64. package/src/generated/google/rpc/error_details.ts +0 -1386
  65. package/src/generated/google/rpc/status.ts +0 -127
  66. package/src/generated/sid/v1/account/account.client.ts +0 -527
  67. package/src/generated/sid/v1/account/account.ts +0 -3261
  68. package/src/generated/sid/v1/admin/admin.client.ts +0 -139
  69. package/src/generated/sid/v1/admin/admin.ts +0 -781
  70. package/src/generated/sid/v1/admin/admin_roles.client.ts +0 -181
  71. package/src/generated/sid/v1/admin/admin_roles.ts +0 -1606
  72. package/src/generated/sid/v1/admin/analytics.client.ts +0 -106
  73. package/src/generated/sid/v1/admin/analytics.ts +0 -1017
  74. package/src/generated/sid/v1/admin/branding.client.ts +0 -166
  75. package/src/generated/sid/v1/admin/branding.ts +0 -1906
  76. package/src/generated/sid/v1/admin/enrollment.client.ts +0 -177
  77. package/src/generated/sid/v1/admin/enrollment.ts +0 -1766
  78. package/src/generated/sid/v1/admin/events.client.ts +0 -195
  79. package/src/generated/sid/v1/admin/events.ts +0 -1900
  80. package/src/generated/sid/v1/admin/flow.client.ts +0 -183
  81. package/src/generated/sid/v1/admin/flow.ts +0 -1552
  82. package/src/generated/sid/v1/admin/keys.client.ts +0 -107
  83. package/src/generated/sid/v1/admin/keys.ts +0 -931
  84. package/src/generated/sid/v1/admin/login_experience.client.ts +0 -160
  85. package/src/generated/sid/v1/admin/login_experience.ts +0 -1061
  86. package/src/generated/sid/v1/admin/migration.client.ts +0 -127
  87. package/src/generated/sid/v1/admin/migration.ts +0 -1948
  88. package/src/generated/sid/v1/admin/notifications.client.ts +0 -134
  89. package/src/generated/sid/v1/admin/notifications.ts +0 -1273
  90. package/src/generated/sid/v1/admin/operations.client.ts +0 -241
  91. package/src/generated/sid/v1/admin/operations.ts +0 -2633
  92. package/src/generated/sid/v1/admin/organizations.client.ts +0 -57
  93. package/src/generated/sid/v1/admin/organizations.ts +0 -332
  94. package/src/generated/sid/v1/admin/provisioning.client.ts +0 -232
  95. package/src/generated/sid/v1/admin/provisioning.ts +0 -1383
  96. package/src/generated/sid/v1/admin/scopes.client.ts +0 -171
  97. package/src/generated/sid/v1/admin/scopes.ts +0 -1324
  98. package/src/generated/sid/v1/admin/security.client.ts +0 -410
  99. package/src/generated/sid/v1/admin/security.ts +0 -4077
  100. package/src/generated/sid/v1/admin/sessions.client.ts +0 -114
  101. package/src/generated/sid/v1/admin/sessions.ts +0 -923
  102. package/src/generated/sid/v1/admin/settings.client.ts +0 -351
  103. package/src/generated/sid/v1/admin/settings.ts +0 -2458
  104. package/src/generated/sid/v1/admin/user_profile.client.ts +0 -57
  105. package/src/generated/sid/v1/admin/user_profile.ts +0 -730
  106. package/src/generated/sid/v1/admin/webhooks.client.ts +0 -269
  107. package/src/generated/sid/v1/admin/webhooks.ts +0 -2804
  108. package/src/generated/sid/v1/attestation/attestation.client.ts +0 -115
  109. package/src/generated/sid/v1/attestation/attestation.ts +0 -813
  110. package/src/generated/sid/v1/authn/auth.client.ts +0 -943
  111. package/src/generated/sid/v1/authn/auth.ts +0 -9719
  112. package/src/generated/sid/v1/authn/flows.client.ts +0 -413
  113. package/src/generated/sid/v1/authn/flows.ts +0 -3205
  114. package/src/generated/sid/v1/authn/issuer.client.ts +0 -489
  115. package/src/generated/sid/v1/authn/issuer.ts +0 -1600
  116. package/src/generated/sid/v1/authn/password_history.client.ts +0 -57
  117. package/src/generated/sid/v1/authn/password_history.ts +0 -578
  118. package/src/generated/sid/v1/authn/system_integration.client.ts +0 -73
  119. package/src/generated/sid/v1/authn/system_integration.ts +0 -218
  120. package/src/generated/sid/v1/authz/authz.client.ts +0 -459
  121. package/src/generated/sid/v1/authz/authz.ts +0 -6524
  122. package/src/generated/sid/v1/authz/forward_auth.client.ts +0 -97
  123. package/src/generated/sid/v1/authz/forward_auth.ts +0 -79
  124. package/src/generated/sid/v1/authz/governance.client.ts +0 -102
  125. package/src/generated/sid/v1/authz/governance.ts +0 -875
  126. package/src/generated/sid/v1/common/errors.ts +0 -710
  127. package/src/generated/sid/v1/common/pagination.ts +0 -152
  128. package/src/generated/sid/v1/common/transport.ts +0 -227
  129. package/src/generated/sid/v1/common/types.ts +0 -151
  130. package/src/generated/sid/v1/events/event_stream.client.ts +0 -67
  131. package/src/generated/sid/v1/events/event_stream.ts +0 -375
  132. package/src/generated/sid/v1/federation/upstream.client.ts +0 -142
  133. package/src/generated/sid/v1/federation/upstream.ts +0 -1736
  134. package/src/generated/sid/v1/identity/identity.client.ts +0 -467
  135. package/src/generated/sid/v1/identity/identity.ts +0 -5676
  136. package/src/generated/sid/v1/ids/ids.ts +0 -395
  137. package/src/generated/sid/v1/machine/machine_user.client.ts +0 -219
  138. package/src/generated/sid/v1/machine/machine_user.ts +0 -2364
  139. package/src/generated/sid/v1/machine/pat.client.ts +0 -130
  140. package/src/generated/sid/v1/machine/pat.ts +0 -1083
  141. package/src/generated/sid/v1/projects/projects.client.ts +0 -404
  142. package/src/generated/sid/v1/projects/projects.ts +0 -4446
  143. package/src/generated/sid/v1/scim/scim.client.ts +0 -520
  144. package/src/generated/sid/v1/scim/scim.ts +0 -3182
  145. package/src/generated/sid/v1/test/test.client.ts +0 -232
  146. package/src/generated/sid/v1/test/test.ts +0 -1136
  147. package/src/transport/adaptive.test.ts +0 -728
  148. package/src/transport/adaptive.ts +0 -308
  149. package/src/transport/framing.test.ts +0 -227
  150. package/src/transport/framing.ts +0 -98
  151. package/src/transport/webtransport.test.ts +0 -728
  152. package/src/transport/webtransport.ts +0 -323
@@ -1,287 +0,0 @@
1
- // @generated by protobuf-ts 2.11.1 with parameter client_generic,generate_dependencies
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
- * Example 5: Compute Timestamp from Java `Instant.now()`.
101
- *
102
- * Instant now = Instant.now();
103
- *
104
- * Timestamp timestamp =
105
- * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
106
- * .setNanos(now.getNano()).build();
107
- *
108
- * Example 6: Compute Timestamp from current time in Python.
109
- *
110
- * timestamp = Timestamp()
111
- * timestamp.GetCurrentTime()
112
- *
113
- * # JSON Mapping
114
- *
115
- * In JSON format, the Timestamp type is encoded as a string in the
116
- * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
117
- * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
118
- * where {year} is always expressed using four digits while {month}, {day},
119
- * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
120
- * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
121
- * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
122
- * is required. A proto3 JSON serializer should always use UTC (as indicated by
123
- * "Z") when printing the Timestamp type and a proto3 JSON parser should be
124
- * able to accept both UTC and other timezones (as indicated by an offset).
125
- *
126
- * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
127
- * 01:30 UTC on January 15, 2017.
128
- *
129
- * In JavaScript, one can convert a Date object to this format using the
130
- * standard
131
- * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
132
- * method. In Python, a standard `datetime.datetime` object can be converted
133
- * to this format using
134
- * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
135
- * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
136
- * the Joda Time's [`ISODateTimeFormat.dateTime()`](
137
- * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
138
- * ) to obtain a formatter capable of generating timestamps in this format.
139
- *
140
- *
141
- * @generated from protobuf message google.protobuf.Timestamp
142
- */
143
- export interface Timestamp {
144
- /**
145
- * Represents seconds of UTC time since Unix epoch
146
- * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
147
- * 9999-12-31T23:59:59Z inclusive.
148
- *
149
- * @generated from protobuf field: int64 seconds = 1
150
- */
151
- seconds: bigint;
152
- /**
153
- * Non-negative fractions of a second at nanosecond resolution. Negative
154
- * second values with fractions must still have non-negative nanos values
155
- * that count forward in time. Must be from 0 to 999,999,999
156
- * inclusive.
157
- *
158
- * @generated from protobuf field: int32 nanos = 2
159
- */
160
- nanos: number;
161
- }
162
- // @generated message type with reflection information, may provide speed optimized methods
163
- class Timestamp$Type extends MessageType<Timestamp> {
164
- constructor() {
165
- super("google.protobuf.Timestamp", [
166
- { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
167
- { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
168
- ]);
169
- }
170
- /**
171
- * Creates a new `Timestamp` for the current time.
172
- */
173
- now(): Timestamp {
174
- const msg = this.create();
175
- const ms = Date.now();
176
- msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
177
- msg.nanos = (ms % 1000) * 1000000;
178
- return msg;
179
- }
180
- /**
181
- * Converts a `Timestamp` to a JavaScript Date.
182
- */
183
- toDate(message: Timestamp): Date {
184
- return new Date(PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000));
185
- }
186
- /**
187
- * Converts a JavaScript Date to a `Timestamp`.
188
- */
189
- fromDate(date: Date): Timestamp {
190
- const msg = this.create();
191
- const ms = date.getTime();
192
- msg.seconds = PbLong.from(Math.floor(ms / 1000)).toBigInt();
193
- msg.nanos = ((ms % 1000) + (ms < 0 && ms % 1000 !== 0 ? 1000 : 0)) * 1000000;
194
- return msg;
195
- }
196
- /**
197
- * In JSON format, the `Timestamp` type is encoded as a string
198
- * in the RFC 3339 format.
199
- */
200
- internalJsonWrite(message: Timestamp, options: JsonWriteOptions): JsonValue {
201
- let ms = PbLong.from(message.seconds).toNumber() * 1000;
202
- if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
203
- throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");
204
- if (message.nanos < 0)
205
- throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");
206
- let z = "Z";
207
- if (message.nanos > 0) {
208
- let nanosStr = (message.nanos + 1000000000).toString().substring(1);
209
- if (nanosStr.substring(3) === "000000")
210
- z = "." + nanosStr.substring(0, 3) + "Z";
211
- else if (nanosStr.substring(6) === "000")
212
- z = "." + nanosStr.substring(0, 6) + "Z";
213
- else
214
- z = "." + nanosStr + "Z";
215
- }
216
- return new Date(ms).toISOString().replace(".000Z", z);
217
- }
218
- /**
219
- * In JSON format, the `Timestamp` type is encoded as a string
220
- * in the RFC 3339 format.
221
- */
222
- internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Timestamp): Timestamp {
223
- if (typeof json !== "string")
224
- throw new Error("Unable to parse Timestamp from JSON " + typeofJsonValue(json) + ".");
225
- 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]))$/);
226
- if (!matches)
227
- throw new Error("Unable to parse Timestamp from JSON. Invalid format.");
228
- let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z"));
229
- if (Number.isNaN(ms))
230
- throw new Error("Unable to parse Timestamp from JSON. Invalid value.");
231
- if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z"))
232
- 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.");
233
- if (!target)
234
- target = this.create();
235
- target.seconds = PbLong.from(ms / 1000).toBigInt();
236
- target.nanos = 0;
237
- if (matches[7])
238
- target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000);
239
- return target;
240
- }
241
- create(value?: PartialMessage<Timestamp>): Timestamp {
242
- const message = globalThis.Object.create((this.messagePrototype!));
243
- message.seconds = 0n;
244
- message.nanos = 0;
245
- if (value !== undefined)
246
- reflectionMergePartial<Timestamp>(this, message, value);
247
- return message;
248
- }
249
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Timestamp): Timestamp {
250
- let message = target ?? this.create(), end = reader.pos + length;
251
- while (reader.pos < end) {
252
- let [fieldNo, wireType] = reader.tag();
253
- switch (fieldNo) {
254
- case /* int64 seconds */ 1:
255
- message.seconds = reader.int64().toBigInt();
256
- break;
257
- case /* int32 nanos */ 2:
258
- message.nanos = reader.int32();
259
- break;
260
- default:
261
- let u = options.readUnknownField;
262
- if (u === "throw")
263
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
264
- let d = reader.skip(wireType);
265
- if (u !== false)
266
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
267
- }
268
- }
269
- return message;
270
- }
271
- internalBinaryWrite(message: Timestamp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
272
- /* int64 seconds = 1; */
273
- if (message.seconds !== 0n)
274
- writer.tag(1, WireType.Varint).int64(message.seconds);
275
- /* int32 nanos = 2; */
276
- if (message.nanos !== 0)
277
- writer.tag(2, WireType.Varint).int32(message.nanos);
278
- let u = options.writeUnknownFields;
279
- if (u !== false)
280
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
281
- return writer;
282
- }
283
- }
284
- /**
285
- * @generated MessageType for protobuf message google.protobuf.Timestamp
286
- */
287
- export const Timestamp = new Timestamp$Type();