@miradorlabs/web-grpc 2.3.0 → 2.4.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.
|
@@ -0,0 +1,1845 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: proto/gateway/web/v1/log_gateway.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { Metadata } from "@grpc/grpc-js";
|
|
10
|
+
import { Observable } from "rxjs";
|
|
11
|
+
import { map } from "rxjs/operators";
|
|
12
|
+
import { Timestamp } from "../../../../google/protobuf/timestamp";
|
|
13
|
+
import { TimeRange } from "./metric_gateway";
|
|
14
|
+
import { AnalyticsTimeInterval, analyticsTimeIntervalFromJSON, analyticsTimeIntervalToJSON } from "./trace_gateway";
|
|
15
|
+
|
|
16
|
+
export const protobufPackage = "gateway.web.v1";
|
|
17
|
+
|
|
18
|
+
export interface StreamLogsRequest {
|
|
19
|
+
/** Verified against the caller's identity before proxying. */
|
|
20
|
+
organizationId: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
/**
|
|
23
|
+
* AIP-160 (https://google.aip.dev/160) filter expression; empty matches all.
|
|
24
|
+
* Values are double-quoted. Terms combine with AND, OR (single field only),
|
|
25
|
+
* NOT and parentheses. Supported fields:
|
|
26
|
+
* body:"payment failed" — case-insensitive token search: the term is
|
|
27
|
+
* split on non-alphanumerics and every token
|
|
28
|
+
* must appear in the body (no substrings).
|
|
29
|
+
* Repeated body: terms AND their tokens.
|
|
30
|
+
* severity>="error" — =, !=, <, <=, >, >= over the level order
|
|
31
|
+
* trace < debug < info < warn < error < fatal
|
|
32
|
+
* ("warning" = alias of "warn"; "unspecified"
|
|
33
|
+
* matches unleveled records, = and != only).
|
|
34
|
+
* service.name="checkout" — =, !=, or OR of values.
|
|
35
|
+
* trace_id="abc123..." — exact hex match; same for span_id.
|
|
36
|
+
* attribute.http.route="/pay" — =, !=, or OR of values on one key; log
|
|
37
|
+
* attributes resolve first, then resource.
|
|
38
|
+
* Dotted keys need no quoting.
|
|
39
|
+
* Example:
|
|
40
|
+
* severity>="error" AND service.name="checkout" AND body:"timeout"
|
|
41
|
+
*/
|
|
42
|
+
filter: string;
|
|
43
|
+
timeRange:
|
|
44
|
+
| TimeRange
|
|
45
|
+
| undefined;
|
|
46
|
+
/** Snapshot size and per-tick tail cap. 0 = server default (100); server-capped at 1000. */
|
|
47
|
+
limit: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface LogDataEnvelope {
|
|
51
|
+
snapshot?:
|
|
52
|
+
| LogSnapshot
|
|
53
|
+
| undefined;
|
|
54
|
+
/** Live tail: one newly-ingested matching record, in arrival order. */
|
|
55
|
+
appended?: LogEntry | undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface LogSnapshot {
|
|
59
|
+
/** Newest first, at most the request limit. */
|
|
60
|
+
records: LogEntry[];
|
|
61
|
+
rangeStart: Date | undefined;
|
|
62
|
+
rangeEnd: Date | undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface LogEntry {
|
|
66
|
+
time: Date | undefined;
|
|
67
|
+
severityNumber: number;
|
|
68
|
+
severityText: string;
|
|
69
|
+
serviceName: string;
|
|
70
|
+
body: string;
|
|
71
|
+
attributes: { [key: string]: string };
|
|
72
|
+
resourceAttributes: { [key: string]: string };
|
|
73
|
+
traceId: string;
|
|
74
|
+
spanId: string;
|
|
75
|
+
eventName: string;
|
|
76
|
+
scopeName: string;
|
|
77
|
+
scopeVersion: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface LogEntry_AttributesEntry {
|
|
81
|
+
key: string;
|
|
82
|
+
value: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface LogEntry_ResourceAttributesEntry {
|
|
86
|
+
key: string;
|
|
87
|
+
value: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface StreamLogHistogramRequest {
|
|
91
|
+
/** Verified against the caller's identity before proxying. */
|
|
92
|
+
organizationId: string;
|
|
93
|
+
projectId: string;
|
|
94
|
+
/** Same AIP-160 grammar as StreamLogsRequest.filter. */
|
|
95
|
+
filter: string;
|
|
96
|
+
timeRange:
|
|
97
|
+
| TimeRange
|
|
98
|
+
| undefined;
|
|
99
|
+
/**
|
|
100
|
+
* UNSPECIFIED = the server picks a sane interval for the range;
|
|
101
|
+
* WHOLE_RANGE = one bucket (severity totals for the range).
|
|
102
|
+
*/
|
|
103
|
+
timeInterval: AnalyticsTimeInterval;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface LogHistogramEnvelope {
|
|
107
|
+
snapshot?: LogHistogramSnapshot | undefined;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface LogHistogramSnapshot {
|
|
111
|
+
/** Sparse: (bucket, level) pairs with zero count are omitted. */
|
|
112
|
+
buckets: LogHistogramBucket[];
|
|
113
|
+
rangeStart: Date | undefined;
|
|
114
|
+
rangeEnd: Date | undefined;
|
|
115
|
+
bucketSizeMs: number;
|
|
116
|
+
/** Drives frontend gap fill; 1 for WHOLE_RANGE. */
|
|
117
|
+
expectedBucketCount: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface LogHistogramBucket {
|
|
121
|
+
bucketStart:
|
|
122
|
+
| Date
|
|
123
|
+
| undefined;
|
|
124
|
+
/**
|
|
125
|
+
* fatal / error / warn / info / debug / trace / unspecified, derived from
|
|
126
|
+
* OTLP severity number ranges.
|
|
127
|
+
*/
|
|
128
|
+
level: string;
|
|
129
|
+
count: number;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface StreamLogAttributesRequest {
|
|
133
|
+
/** Verified against the caller's identity before proxying. */
|
|
134
|
+
organizationId: string;
|
|
135
|
+
projectId: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface LogAttributeEnvelope {
|
|
139
|
+
snapshot?: LogAttributeSnapshot | undefined;
|
|
140
|
+
added?: LogAttribute | undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface LogAttributeSnapshot {
|
|
144
|
+
attributes: LogAttribute[];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** LogAttribute is one attribute key with a sample of observed values. */
|
|
148
|
+
export interface LogAttribute {
|
|
149
|
+
key: string;
|
|
150
|
+
values: string[];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function createBaseStreamLogsRequest(): StreamLogsRequest {
|
|
154
|
+
return { organizationId: "", projectId: "", filter: "", timeRange: undefined, limit: 0 };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const StreamLogsRequest: MessageFns<StreamLogsRequest> = {
|
|
158
|
+
encode(message: StreamLogsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
159
|
+
if (message.organizationId !== "") {
|
|
160
|
+
writer.uint32(10).string(message.organizationId);
|
|
161
|
+
}
|
|
162
|
+
if (message.projectId !== "") {
|
|
163
|
+
writer.uint32(18).string(message.projectId);
|
|
164
|
+
}
|
|
165
|
+
if (message.filter !== "") {
|
|
166
|
+
writer.uint32(26).string(message.filter);
|
|
167
|
+
}
|
|
168
|
+
if (message.timeRange !== undefined) {
|
|
169
|
+
TimeRange.encode(message.timeRange, writer.uint32(34).fork()).join();
|
|
170
|
+
}
|
|
171
|
+
if (message.limit !== 0) {
|
|
172
|
+
writer.uint32(40).int32(message.limit);
|
|
173
|
+
}
|
|
174
|
+
return writer;
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamLogsRequest {
|
|
178
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
179
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
180
|
+
const message = createBaseStreamLogsRequest();
|
|
181
|
+
while (reader.pos < end) {
|
|
182
|
+
const tag = reader.uint32();
|
|
183
|
+
switch (tag >>> 3) {
|
|
184
|
+
case 1: {
|
|
185
|
+
if (tag !== 10) {
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
message.organizationId = reader.string();
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
case 2: {
|
|
193
|
+
if (tag !== 18) {
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
message.projectId = reader.string();
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
case 3: {
|
|
201
|
+
if (tag !== 26) {
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
message.filter = reader.string();
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
case 4: {
|
|
209
|
+
if (tag !== 34) {
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
message.timeRange = TimeRange.decode(reader, reader.uint32());
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
case 5: {
|
|
217
|
+
if (tag !== 40) {
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
message.limit = reader.int32();
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
reader.skip(tag & 7);
|
|
229
|
+
}
|
|
230
|
+
return message;
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
fromJSON(object: any): StreamLogsRequest {
|
|
234
|
+
return {
|
|
235
|
+
organizationId: isSet(object.organizationId)
|
|
236
|
+
? globalThis.String(object.organizationId)
|
|
237
|
+
: isSet(object.organization_id)
|
|
238
|
+
? globalThis.String(object.organization_id)
|
|
239
|
+
: "",
|
|
240
|
+
projectId: isSet(object.projectId)
|
|
241
|
+
? globalThis.String(object.projectId)
|
|
242
|
+
: isSet(object.project_id)
|
|
243
|
+
? globalThis.String(object.project_id)
|
|
244
|
+
: "",
|
|
245
|
+
filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
|
|
246
|
+
timeRange: isSet(object.timeRange)
|
|
247
|
+
? TimeRange.fromJSON(object.timeRange)
|
|
248
|
+
: isSet(object.time_range)
|
|
249
|
+
? TimeRange.fromJSON(object.time_range)
|
|
250
|
+
: undefined,
|
|
251
|
+
limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
toJSON(message: StreamLogsRequest): unknown {
|
|
256
|
+
const obj: any = {};
|
|
257
|
+
if (message.organizationId !== "") {
|
|
258
|
+
obj.organizationId = message.organizationId;
|
|
259
|
+
}
|
|
260
|
+
if (message.projectId !== "") {
|
|
261
|
+
obj.projectId = message.projectId;
|
|
262
|
+
}
|
|
263
|
+
if (message.filter !== "") {
|
|
264
|
+
obj.filter = message.filter;
|
|
265
|
+
}
|
|
266
|
+
if (message.timeRange !== undefined) {
|
|
267
|
+
obj.timeRange = TimeRange.toJSON(message.timeRange);
|
|
268
|
+
}
|
|
269
|
+
if (message.limit !== 0) {
|
|
270
|
+
obj.limit = Math.round(message.limit);
|
|
271
|
+
}
|
|
272
|
+
return obj;
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
create<I extends Exact<DeepPartial<StreamLogsRequest>, I>>(base?: I): StreamLogsRequest {
|
|
276
|
+
return StreamLogsRequest.fromPartial(base ?? ({} as any));
|
|
277
|
+
},
|
|
278
|
+
fromPartial<I extends Exact<DeepPartial<StreamLogsRequest>, I>>(object: I): StreamLogsRequest {
|
|
279
|
+
const message = createBaseStreamLogsRequest();
|
|
280
|
+
message.organizationId = object.organizationId ?? "";
|
|
281
|
+
message.projectId = object.projectId ?? "";
|
|
282
|
+
message.filter = object.filter ?? "";
|
|
283
|
+
message.timeRange = (object.timeRange !== undefined && object.timeRange !== null)
|
|
284
|
+
? TimeRange.fromPartial(object.timeRange)
|
|
285
|
+
: undefined;
|
|
286
|
+
message.limit = object.limit ?? 0;
|
|
287
|
+
return message;
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
function createBaseLogDataEnvelope(): LogDataEnvelope {
|
|
292
|
+
return { snapshot: undefined, appended: undefined };
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export const LogDataEnvelope: MessageFns<LogDataEnvelope> = {
|
|
296
|
+
encode(message: LogDataEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
297
|
+
if (message.snapshot !== undefined) {
|
|
298
|
+
LogSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
|
|
299
|
+
}
|
|
300
|
+
if (message.appended !== undefined) {
|
|
301
|
+
LogEntry.encode(message.appended, writer.uint32(18).fork()).join();
|
|
302
|
+
}
|
|
303
|
+
return writer;
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogDataEnvelope {
|
|
307
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
308
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
309
|
+
const message = createBaseLogDataEnvelope();
|
|
310
|
+
while (reader.pos < end) {
|
|
311
|
+
const tag = reader.uint32();
|
|
312
|
+
switch (tag >>> 3) {
|
|
313
|
+
case 1: {
|
|
314
|
+
if (tag !== 10) {
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
message.snapshot = LogSnapshot.decode(reader, reader.uint32());
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
case 2: {
|
|
322
|
+
if (tag !== 18) {
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
message.appended = LogEntry.decode(reader, reader.uint32());
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
reader.skip(tag & 7);
|
|
334
|
+
}
|
|
335
|
+
return message;
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
fromJSON(object: any): LogDataEnvelope {
|
|
339
|
+
return {
|
|
340
|
+
snapshot: isSet(object.snapshot) ? LogSnapshot.fromJSON(object.snapshot) : undefined,
|
|
341
|
+
appended: isSet(object.appended) ? LogEntry.fromJSON(object.appended) : undefined,
|
|
342
|
+
};
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
toJSON(message: LogDataEnvelope): unknown {
|
|
346
|
+
const obj: any = {};
|
|
347
|
+
if (message.snapshot !== undefined) {
|
|
348
|
+
obj.snapshot = LogSnapshot.toJSON(message.snapshot);
|
|
349
|
+
}
|
|
350
|
+
if (message.appended !== undefined) {
|
|
351
|
+
obj.appended = LogEntry.toJSON(message.appended);
|
|
352
|
+
}
|
|
353
|
+
return obj;
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
create<I extends Exact<DeepPartial<LogDataEnvelope>, I>>(base?: I): LogDataEnvelope {
|
|
357
|
+
return LogDataEnvelope.fromPartial(base ?? ({} as any));
|
|
358
|
+
},
|
|
359
|
+
fromPartial<I extends Exact<DeepPartial<LogDataEnvelope>, I>>(object: I): LogDataEnvelope {
|
|
360
|
+
const message = createBaseLogDataEnvelope();
|
|
361
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
362
|
+
? LogSnapshot.fromPartial(object.snapshot)
|
|
363
|
+
: undefined;
|
|
364
|
+
message.appended = (object.appended !== undefined && object.appended !== null)
|
|
365
|
+
? LogEntry.fromPartial(object.appended)
|
|
366
|
+
: undefined;
|
|
367
|
+
return message;
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
function createBaseLogSnapshot(): LogSnapshot {
|
|
372
|
+
return { records: [], rangeStart: undefined, rangeEnd: undefined };
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export const LogSnapshot: MessageFns<LogSnapshot> = {
|
|
376
|
+
encode(message: LogSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
377
|
+
for (const v of message.records) {
|
|
378
|
+
LogEntry.encode(v!, writer.uint32(10).fork()).join();
|
|
379
|
+
}
|
|
380
|
+
if (message.rangeStart !== undefined) {
|
|
381
|
+
Timestamp.encode(toTimestamp(message.rangeStart), writer.uint32(18).fork()).join();
|
|
382
|
+
}
|
|
383
|
+
if (message.rangeEnd !== undefined) {
|
|
384
|
+
Timestamp.encode(toTimestamp(message.rangeEnd), writer.uint32(26).fork()).join();
|
|
385
|
+
}
|
|
386
|
+
return writer;
|
|
387
|
+
},
|
|
388
|
+
|
|
389
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogSnapshot {
|
|
390
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
391
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
392
|
+
const message = createBaseLogSnapshot();
|
|
393
|
+
while (reader.pos < end) {
|
|
394
|
+
const tag = reader.uint32();
|
|
395
|
+
switch (tag >>> 3) {
|
|
396
|
+
case 1: {
|
|
397
|
+
if (tag !== 10) {
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
message.records.push(LogEntry.decode(reader, reader.uint32()));
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
404
|
+
case 2: {
|
|
405
|
+
if (tag !== 18) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
message.rangeStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
case 3: {
|
|
413
|
+
if (tag !== 26) {
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
message.rangeEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
reader.skip(tag & 7);
|
|
425
|
+
}
|
|
426
|
+
return message;
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
fromJSON(object: any): LogSnapshot {
|
|
430
|
+
return {
|
|
431
|
+
records: globalThis.Array.isArray(object?.records) ? object.records.map((e: any) => LogEntry.fromJSON(e)) : [],
|
|
432
|
+
rangeStart: isSet(object.rangeStart)
|
|
433
|
+
? fromJsonTimestamp(object.rangeStart)
|
|
434
|
+
: isSet(object.range_start)
|
|
435
|
+
? fromJsonTimestamp(object.range_start)
|
|
436
|
+
: undefined,
|
|
437
|
+
rangeEnd: isSet(object.rangeEnd)
|
|
438
|
+
? fromJsonTimestamp(object.rangeEnd)
|
|
439
|
+
: isSet(object.range_end)
|
|
440
|
+
? fromJsonTimestamp(object.range_end)
|
|
441
|
+
: undefined,
|
|
442
|
+
};
|
|
443
|
+
},
|
|
444
|
+
|
|
445
|
+
toJSON(message: LogSnapshot): unknown {
|
|
446
|
+
const obj: any = {};
|
|
447
|
+
if (message.records?.length) {
|
|
448
|
+
obj.records = message.records.map((e) => LogEntry.toJSON(e));
|
|
449
|
+
}
|
|
450
|
+
if (message.rangeStart !== undefined) {
|
|
451
|
+
obj.rangeStart = message.rangeStart.toISOString();
|
|
452
|
+
}
|
|
453
|
+
if (message.rangeEnd !== undefined) {
|
|
454
|
+
obj.rangeEnd = message.rangeEnd.toISOString();
|
|
455
|
+
}
|
|
456
|
+
return obj;
|
|
457
|
+
},
|
|
458
|
+
|
|
459
|
+
create<I extends Exact<DeepPartial<LogSnapshot>, I>>(base?: I): LogSnapshot {
|
|
460
|
+
return LogSnapshot.fromPartial(base ?? ({} as any));
|
|
461
|
+
},
|
|
462
|
+
fromPartial<I extends Exact<DeepPartial<LogSnapshot>, I>>(object: I): LogSnapshot {
|
|
463
|
+
const message = createBaseLogSnapshot();
|
|
464
|
+
message.records = object.records?.map((e) => LogEntry.fromPartial(e)) || [];
|
|
465
|
+
message.rangeStart = object.rangeStart ?? undefined;
|
|
466
|
+
message.rangeEnd = object.rangeEnd ?? undefined;
|
|
467
|
+
return message;
|
|
468
|
+
},
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
function createBaseLogEntry(): LogEntry {
|
|
472
|
+
return {
|
|
473
|
+
time: undefined,
|
|
474
|
+
severityNumber: 0,
|
|
475
|
+
severityText: "",
|
|
476
|
+
serviceName: "",
|
|
477
|
+
body: "",
|
|
478
|
+
attributes: {},
|
|
479
|
+
resourceAttributes: {},
|
|
480
|
+
traceId: "",
|
|
481
|
+
spanId: "",
|
|
482
|
+
eventName: "",
|
|
483
|
+
scopeName: "",
|
|
484
|
+
scopeVersion: "",
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export const LogEntry: MessageFns<LogEntry> = {
|
|
489
|
+
encode(message: LogEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
490
|
+
if (message.time !== undefined) {
|
|
491
|
+
Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).join();
|
|
492
|
+
}
|
|
493
|
+
if (message.severityNumber !== 0) {
|
|
494
|
+
writer.uint32(16).uint32(message.severityNumber);
|
|
495
|
+
}
|
|
496
|
+
if (message.severityText !== "") {
|
|
497
|
+
writer.uint32(26).string(message.severityText);
|
|
498
|
+
}
|
|
499
|
+
if (message.serviceName !== "") {
|
|
500
|
+
writer.uint32(34).string(message.serviceName);
|
|
501
|
+
}
|
|
502
|
+
if (message.body !== "") {
|
|
503
|
+
writer.uint32(42).string(message.body);
|
|
504
|
+
}
|
|
505
|
+
globalThis.Object.entries(message.attributes).forEach(([key, value]: [string, string]) => {
|
|
506
|
+
LogEntry_AttributesEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).join();
|
|
507
|
+
});
|
|
508
|
+
globalThis.Object.entries(message.resourceAttributes).forEach(([key, value]: [string, string]) => {
|
|
509
|
+
LogEntry_ResourceAttributesEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).join();
|
|
510
|
+
});
|
|
511
|
+
if (message.traceId !== "") {
|
|
512
|
+
writer.uint32(66).string(message.traceId);
|
|
513
|
+
}
|
|
514
|
+
if (message.spanId !== "") {
|
|
515
|
+
writer.uint32(74).string(message.spanId);
|
|
516
|
+
}
|
|
517
|
+
if (message.eventName !== "") {
|
|
518
|
+
writer.uint32(82).string(message.eventName);
|
|
519
|
+
}
|
|
520
|
+
if (message.scopeName !== "") {
|
|
521
|
+
writer.uint32(90).string(message.scopeName);
|
|
522
|
+
}
|
|
523
|
+
if (message.scopeVersion !== "") {
|
|
524
|
+
writer.uint32(98).string(message.scopeVersion);
|
|
525
|
+
}
|
|
526
|
+
return writer;
|
|
527
|
+
},
|
|
528
|
+
|
|
529
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogEntry {
|
|
530
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
531
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
532
|
+
const message = createBaseLogEntry();
|
|
533
|
+
while (reader.pos < end) {
|
|
534
|
+
const tag = reader.uint32();
|
|
535
|
+
switch (tag >>> 3) {
|
|
536
|
+
case 1: {
|
|
537
|
+
if (tag !== 10) {
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
case 2: {
|
|
545
|
+
if (tag !== 16) {
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
message.severityNumber = reader.uint32();
|
|
550
|
+
continue;
|
|
551
|
+
}
|
|
552
|
+
case 3: {
|
|
553
|
+
if (tag !== 26) {
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
message.severityText = reader.string();
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
case 4: {
|
|
561
|
+
if (tag !== 34) {
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
message.serviceName = reader.string();
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
case 5: {
|
|
569
|
+
if (tag !== 42) {
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
message.body = reader.string();
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
case 6: {
|
|
577
|
+
if (tag !== 50) {
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
const entry6 = LogEntry_AttributesEntry.decode(reader, reader.uint32());
|
|
582
|
+
if (entry6.value !== undefined) {
|
|
583
|
+
message.attributes[entry6.key] = entry6.value;
|
|
584
|
+
}
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
case 7: {
|
|
588
|
+
if (tag !== 58) {
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
const entry7 = LogEntry_ResourceAttributesEntry.decode(reader, reader.uint32());
|
|
593
|
+
if (entry7.value !== undefined) {
|
|
594
|
+
message.resourceAttributes[entry7.key] = entry7.value;
|
|
595
|
+
}
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
case 8: {
|
|
599
|
+
if (tag !== 66) {
|
|
600
|
+
break;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
message.traceId = reader.string();
|
|
604
|
+
continue;
|
|
605
|
+
}
|
|
606
|
+
case 9: {
|
|
607
|
+
if (tag !== 74) {
|
|
608
|
+
break;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
message.spanId = reader.string();
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
case 10: {
|
|
615
|
+
if (tag !== 82) {
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
message.eventName = reader.string();
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
case 11: {
|
|
623
|
+
if (tag !== 90) {
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
message.scopeName = reader.string();
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
case 12: {
|
|
631
|
+
if (tag !== 98) {
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
message.scopeVersion = reader.string();
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
reader.skip(tag & 7);
|
|
643
|
+
}
|
|
644
|
+
return message;
|
|
645
|
+
},
|
|
646
|
+
|
|
647
|
+
fromJSON(object: any): LogEntry {
|
|
648
|
+
return {
|
|
649
|
+
time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
|
|
650
|
+
severityNumber: isSet(object.severityNumber)
|
|
651
|
+
? globalThis.Number(object.severityNumber)
|
|
652
|
+
: isSet(object.severity_number)
|
|
653
|
+
? globalThis.Number(object.severity_number)
|
|
654
|
+
: 0,
|
|
655
|
+
severityText: isSet(object.severityText)
|
|
656
|
+
? globalThis.String(object.severityText)
|
|
657
|
+
: isSet(object.severity_text)
|
|
658
|
+
? globalThis.String(object.severity_text)
|
|
659
|
+
: "",
|
|
660
|
+
serviceName: isSet(object.serviceName)
|
|
661
|
+
? globalThis.String(object.serviceName)
|
|
662
|
+
: isSet(object.service_name)
|
|
663
|
+
? globalThis.String(object.service_name)
|
|
664
|
+
: "",
|
|
665
|
+
body: isSet(object.body) ? globalThis.String(object.body) : "",
|
|
666
|
+
attributes: isObject(object.attributes)
|
|
667
|
+
? (globalThis.Object.entries(object.attributes) as [string, any][]).reduce(
|
|
668
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
669
|
+
acc[key] = globalThis.String(value);
|
|
670
|
+
return acc;
|
|
671
|
+
},
|
|
672
|
+
{},
|
|
673
|
+
)
|
|
674
|
+
: {},
|
|
675
|
+
resourceAttributes: isObject(object.resourceAttributes)
|
|
676
|
+
? (globalThis.Object.entries(object.resourceAttributes) as [string, any][]).reduce(
|
|
677
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
678
|
+
acc[key] = globalThis.String(value);
|
|
679
|
+
return acc;
|
|
680
|
+
},
|
|
681
|
+
{},
|
|
682
|
+
)
|
|
683
|
+
: isObject(object.resource_attributes)
|
|
684
|
+
? (globalThis.Object.entries(object.resource_attributes) as [string, any][]).reduce(
|
|
685
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
686
|
+
acc[key] = globalThis.String(value);
|
|
687
|
+
return acc;
|
|
688
|
+
},
|
|
689
|
+
{},
|
|
690
|
+
)
|
|
691
|
+
: {},
|
|
692
|
+
traceId: isSet(object.traceId)
|
|
693
|
+
? globalThis.String(object.traceId)
|
|
694
|
+
: isSet(object.trace_id)
|
|
695
|
+
? globalThis.String(object.trace_id)
|
|
696
|
+
: "",
|
|
697
|
+
spanId: isSet(object.spanId)
|
|
698
|
+
? globalThis.String(object.spanId)
|
|
699
|
+
: isSet(object.span_id)
|
|
700
|
+
? globalThis.String(object.span_id)
|
|
701
|
+
: "",
|
|
702
|
+
eventName: isSet(object.eventName)
|
|
703
|
+
? globalThis.String(object.eventName)
|
|
704
|
+
: isSet(object.event_name)
|
|
705
|
+
? globalThis.String(object.event_name)
|
|
706
|
+
: "",
|
|
707
|
+
scopeName: isSet(object.scopeName)
|
|
708
|
+
? globalThis.String(object.scopeName)
|
|
709
|
+
: isSet(object.scope_name)
|
|
710
|
+
? globalThis.String(object.scope_name)
|
|
711
|
+
: "",
|
|
712
|
+
scopeVersion: isSet(object.scopeVersion)
|
|
713
|
+
? globalThis.String(object.scopeVersion)
|
|
714
|
+
: isSet(object.scope_version)
|
|
715
|
+
? globalThis.String(object.scope_version)
|
|
716
|
+
: "",
|
|
717
|
+
};
|
|
718
|
+
},
|
|
719
|
+
|
|
720
|
+
toJSON(message: LogEntry): unknown {
|
|
721
|
+
const obj: any = {};
|
|
722
|
+
if (message.time !== undefined) {
|
|
723
|
+
obj.time = message.time.toISOString();
|
|
724
|
+
}
|
|
725
|
+
if (message.severityNumber !== 0) {
|
|
726
|
+
obj.severityNumber = Math.round(message.severityNumber);
|
|
727
|
+
}
|
|
728
|
+
if (message.severityText !== "") {
|
|
729
|
+
obj.severityText = message.severityText;
|
|
730
|
+
}
|
|
731
|
+
if (message.serviceName !== "") {
|
|
732
|
+
obj.serviceName = message.serviceName;
|
|
733
|
+
}
|
|
734
|
+
if (message.body !== "") {
|
|
735
|
+
obj.body = message.body;
|
|
736
|
+
}
|
|
737
|
+
if (message.attributes) {
|
|
738
|
+
const entries = globalThis.Object.entries(message.attributes) as [string, string][];
|
|
739
|
+
if (entries.length > 0) {
|
|
740
|
+
obj.attributes = {};
|
|
741
|
+
entries.forEach(([k, v]) => {
|
|
742
|
+
obj.attributes[k] = v;
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
if (message.resourceAttributes) {
|
|
747
|
+
const entries = globalThis.Object.entries(message.resourceAttributes) as [string, string][];
|
|
748
|
+
if (entries.length > 0) {
|
|
749
|
+
obj.resourceAttributes = {};
|
|
750
|
+
entries.forEach(([k, v]) => {
|
|
751
|
+
obj.resourceAttributes[k] = v;
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
if (message.traceId !== "") {
|
|
756
|
+
obj.traceId = message.traceId;
|
|
757
|
+
}
|
|
758
|
+
if (message.spanId !== "") {
|
|
759
|
+
obj.spanId = message.spanId;
|
|
760
|
+
}
|
|
761
|
+
if (message.eventName !== "") {
|
|
762
|
+
obj.eventName = message.eventName;
|
|
763
|
+
}
|
|
764
|
+
if (message.scopeName !== "") {
|
|
765
|
+
obj.scopeName = message.scopeName;
|
|
766
|
+
}
|
|
767
|
+
if (message.scopeVersion !== "") {
|
|
768
|
+
obj.scopeVersion = message.scopeVersion;
|
|
769
|
+
}
|
|
770
|
+
return obj;
|
|
771
|
+
},
|
|
772
|
+
|
|
773
|
+
create<I extends Exact<DeepPartial<LogEntry>, I>>(base?: I): LogEntry {
|
|
774
|
+
return LogEntry.fromPartial(base ?? ({} as any));
|
|
775
|
+
},
|
|
776
|
+
fromPartial<I extends Exact<DeepPartial<LogEntry>, I>>(object: I): LogEntry {
|
|
777
|
+
const message = createBaseLogEntry();
|
|
778
|
+
message.time = object.time ?? undefined;
|
|
779
|
+
message.severityNumber = object.severityNumber ?? 0;
|
|
780
|
+
message.severityText = object.severityText ?? "";
|
|
781
|
+
message.serviceName = object.serviceName ?? "";
|
|
782
|
+
message.body = object.body ?? "";
|
|
783
|
+
message.attributes = (globalThis.Object.entries(object.attributes ?? {}) as [string, string][]).reduce(
|
|
784
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
785
|
+
if (value !== undefined) {
|
|
786
|
+
acc[key] = globalThis.String(value);
|
|
787
|
+
}
|
|
788
|
+
return acc;
|
|
789
|
+
},
|
|
790
|
+
{},
|
|
791
|
+
);
|
|
792
|
+
message.resourceAttributes = (globalThis.Object.entries(object.resourceAttributes ?? {}) as [string, string][])
|
|
793
|
+
.reduce((acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
794
|
+
if (value !== undefined) {
|
|
795
|
+
acc[key] = globalThis.String(value);
|
|
796
|
+
}
|
|
797
|
+
return acc;
|
|
798
|
+
}, {});
|
|
799
|
+
message.traceId = object.traceId ?? "";
|
|
800
|
+
message.spanId = object.spanId ?? "";
|
|
801
|
+
message.eventName = object.eventName ?? "";
|
|
802
|
+
message.scopeName = object.scopeName ?? "";
|
|
803
|
+
message.scopeVersion = object.scopeVersion ?? "";
|
|
804
|
+
return message;
|
|
805
|
+
},
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
function createBaseLogEntry_AttributesEntry(): LogEntry_AttributesEntry {
|
|
809
|
+
return { key: "", value: "" };
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
export const LogEntry_AttributesEntry: MessageFns<LogEntry_AttributesEntry> = {
|
|
813
|
+
encode(message: LogEntry_AttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
814
|
+
if (message.key !== "") {
|
|
815
|
+
writer.uint32(10).string(message.key);
|
|
816
|
+
}
|
|
817
|
+
if (message.value !== "") {
|
|
818
|
+
writer.uint32(18).string(message.value);
|
|
819
|
+
}
|
|
820
|
+
return writer;
|
|
821
|
+
},
|
|
822
|
+
|
|
823
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogEntry_AttributesEntry {
|
|
824
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
825
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
826
|
+
const message = createBaseLogEntry_AttributesEntry();
|
|
827
|
+
while (reader.pos < end) {
|
|
828
|
+
const tag = reader.uint32();
|
|
829
|
+
switch (tag >>> 3) {
|
|
830
|
+
case 1: {
|
|
831
|
+
if (tag !== 10) {
|
|
832
|
+
break;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
message.key = reader.string();
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
case 2: {
|
|
839
|
+
if (tag !== 18) {
|
|
840
|
+
break;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
message.value = reader.string();
|
|
844
|
+
continue;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
reader.skip(tag & 7);
|
|
851
|
+
}
|
|
852
|
+
return message;
|
|
853
|
+
},
|
|
854
|
+
|
|
855
|
+
fromJSON(object: any): LogEntry_AttributesEntry {
|
|
856
|
+
return {
|
|
857
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
858
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
859
|
+
};
|
|
860
|
+
},
|
|
861
|
+
|
|
862
|
+
toJSON(message: LogEntry_AttributesEntry): unknown {
|
|
863
|
+
const obj: any = {};
|
|
864
|
+
if (message.key !== "") {
|
|
865
|
+
obj.key = message.key;
|
|
866
|
+
}
|
|
867
|
+
if (message.value !== "") {
|
|
868
|
+
obj.value = message.value;
|
|
869
|
+
}
|
|
870
|
+
return obj;
|
|
871
|
+
},
|
|
872
|
+
|
|
873
|
+
create<I extends Exact<DeepPartial<LogEntry_AttributesEntry>, I>>(base?: I): LogEntry_AttributesEntry {
|
|
874
|
+
return LogEntry_AttributesEntry.fromPartial(base ?? ({} as any));
|
|
875
|
+
},
|
|
876
|
+
fromPartial<I extends Exact<DeepPartial<LogEntry_AttributesEntry>, I>>(object: I): LogEntry_AttributesEntry {
|
|
877
|
+
const message = createBaseLogEntry_AttributesEntry();
|
|
878
|
+
message.key = object.key ?? "";
|
|
879
|
+
message.value = object.value ?? "";
|
|
880
|
+
return message;
|
|
881
|
+
},
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
function createBaseLogEntry_ResourceAttributesEntry(): LogEntry_ResourceAttributesEntry {
|
|
885
|
+
return { key: "", value: "" };
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
export const LogEntry_ResourceAttributesEntry: MessageFns<LogEntry_ResourceAttributesEntry> = {
|
|
889
|
+
encode(message: LogEntry_ResourceAttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
890
|
+
if (message.key !== "") {
|
|
891
|
+
writer.uint32(10).string(message.key);
|
|
892
|
+
}
|
|
893
|
+
if (message.value !== "") {
|
|
894
|
+
writer.uint32(18).string(message.value);
|
|
895
|
+
}
|
|
896
|
+
return writer;
|
|
897
|
+
},
|
|
898
|
+
|
|
899
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogEntry_ResourceAttributesEntry {
|
|
900
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
901
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
902
|
+
const message = createBaseLogEntry_ResourceAttributesEntry();
|
|
903
|
+
while (reader.pos < end) {
|
|
904
|
+
const tag = reader.uint32();
|
|
905
|
+
switch (tag >>> 3) {
|
|
906
|
+
case 1: {
|
|
907
|
+
if (tag !== 10) {
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
message.key = reader.string();
|
|
912
|
+
continue;
|
|
913
|
+
}
|
|
914
|
+
case 2: {
|
|
915
|
+
if (tag !== 18) {
|
|
916
|
+
break;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
message.value = reader.string();
|
|
920
|
+
continue;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
924
|
+
break;
|
|
925
|
+
}
|
|
926
|
+
reader.skip(tag & 7);
|
|
927
|
+
}
|
|
928
|
+
return message;
|
|
929
|
+
},
|
|
930
|
+
|
|
931
|
+
fromJSON(object: any): LogEntry_ResourceAttributesEntry {
|
|
932
|
+
return {
|
|
933
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
934
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
935
|
+
};
|
|
936
|
+
},
|
|
937
|
+
|
|
938
|
+
toJSON(message: LogEntry_ResourceAttributesEntry): unknown {
|
|
939
|
+
const obj: any = {};
|
|
940
|
+
if (message.key !== "") {
|
|
941
|
+
obj.key = message.key;
|
|
942
|
+
}
|
|
943
|
+
if (message.value !== "") {
|
|
944
|
+
obj.value = message.value;
|
|
945
|
+
}
|
|
946
|
+
return obj;
|
|
947
|
+
},
|
|
948
|
+
|
|
949
|
+
create<I extends Exact<DeepPartial<LogEntry_ResourceAttributesEntry>, I>>(
|
|
950
|
+
base?: I,
|
|
951
|
+
): LogEntry_ResourceAttributesEntry {
|
|
952
|
+
return LogEntry_ResourceAttributesEntry.fromPartial(base ?? ({} as any));
|
|
953
|
+
},
|
|
954
|
+
fromPartial<I extends Exact<DeepPartial<LogEntry_ResourceAttributesEntry>, I>>(
|
|
955
|
+
object: I,
|
|
956
|
+
): LogEntry_ResourceAttributesEntry {
|
|
957
|
+
const message = createBaseLogEntry_ResourceAttributesEntry();
|
|
958
|
+
message.key = object.key ?? "";
|
|
959
|
+
message.value = object.value ?? "";
|
|
960
|
+
return message;
|
|
961
|
+
},
|
|
962
|
+
};
|
|
963
|
+
|
|
964
|
+
function createBaseStreamLogHistogramRequest(): StreamLogHistogramRequest {
|
|
965
|
+
return { organizationId: "", projectId: "", filter: "", timeRange: undefined, timeInterval: 0 };
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export const StreamLogHistogramRequest: MessageFns<StreamLogHistogramRequest> = {
|
|
969
|
+
encode(message: StreamLogHistogramRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
970
|
+
if (message.organizationId !== "") {
|
|
971
|
+
writer.uint32(10).string(message.organizationId);
|
|
972
|
+
}
|
|
973
|
+
if (message.projectId !== "") {
|
|
974
|
+
writer.uint32(18).string(message.projectId);
|
|
975
|
+
}
|
|
976
|
+
if (message.filter !== "") {
|
|
977
|
+
writer.uint32(26).string(message.filter);
|
|
978
|
+
}
|
|
979
|
+
if (message.timeRange !== undefined) {
|
|
980
|
+
TimeRange.encode(message.timeRange, writer.uint32(34).fork()).join();
|
|
981
|
+
}
|
|
982
|
+
if (message.timeInterval !== 0) {
|
|
983
|
+
writer.uint32(40).int32(message.timeInterval);
|
|
984
|
+
}
|
|
985
|
+
return writer;
|
|
986
|
+
},
|
|
987
|
+
|
|
988
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamLogHistogramRequest {
|
|
989
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
990
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
991
|
+
const message = createBaseStreamLogHistogramRequest();
|
|
992
|
+
while (reader.pos < end) {
|
|
993
|
+
const tag = reader.uint32();
|
|
994
|
+
switch (tag >>> 3) {
|
|
995
|
+
case 1: {
|
|
996
|
+
if (tag !== 10) {
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
message.organizationId = reader.string();
|
|
1001
|
+
continue;
|
|
1002
|
+
}
|
|
1003
|
+
case 2: {
|
|
1004
|
+
if (tag !== 18) {
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
message.projectId = reader.string();
|
|
1009
|
+
continue;
|
|
1010
|
+
}
|
|
1011
|
+
case 3: {
|
|
1012
|
+
if (tag !== 26) {
|
|
1013
|
+
break;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
message.filter = reader.string();
|
|
1017
|
+
continue;
|
|
1018
|
+
}
|
|
1019
|
+
case 4: {
|
|
1020
|
+
if (tag !== 34) {
|
|
1021
|
+
break;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
message.timeRange = TimeRange.decode(reader, reader.uint32());
|
|
1025
|
+
continue;
|
|
1026
|
+
}
|
|
1027
|
+
case 5: {
|
|
1028
|
+
if (tag !== 40) {
|
|
1029
|
+
break;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
message.timeInterval = reader.int32() as any;
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
reader.skip(tag & 7);
|
|
1040
|
+
}
|
|
1041
|
+
return message;
|
|
1042
|
+
},
|
|
1043
|
+
|
|
1044
|
+
fromJSON(object: any): StreamLogHistogramRequest {
|
|
1045
|
+
return {
|
|
1046
|
+
organizationId: isSet(object.organizationId)
|
|
1047
|
+
? globalThis.String(object.organizationId)
|
|
1048
|
+
: isSet(object.organization_id)
|
|
1049
|
+
? globalThis.String(object.organization_id)
|
|
1050
|
+
: "",
|
|
1051
|
+
projectId: isSet(object.projectId)
|
|
1052
|
+
? globalThis.String(object.projectId)
|
|
1053
|
+
: isSet(object.project_id)
|
|
1054
|
+
? globalThis.String(object.project_id)
|
|
1055
|
+
: "",
|
|
1056
|
+
filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
|
|
1057
|
+
timeRange: isSet(object.timeRange)
|
|
1058
|
+
? TimeRange.fromJSON(object.timeRange)
|
|
1059
|
+
: isSet(object.time_range)
|
|
1060
|
+
? TimeRange.fromJSON(object.time_range)
|
|
1061
|
+
: undefined,
|
|
1062
|
+
timeInterval: isSet(object.timeInterval)
|
|
1063
|
+
? analyticsTimeIntervalFromJSON(object.timeInterval)
|
|
1064
|
+
: isSet(object.time_interval)
|
|
1065
|
+
? analyticsTimeIntervalFromJSON(object.time_interval)
|
|
1066
|
+
: 0,
|
|
1067
|
+
};
|
|
1068
|
+
},
|
|
1069
|
+
|
|
1070
|
+
toJSON(message: StreamLogHistogramRequest): unknown {
|
|
1071
|
+
const obj: any = {};
|
|
1072
|
+
if (message.organizationId !== "") {
|
|
1073
|
+
obj.organizationId = message.organizationId;
|
|
1074
|
+
}
|
|
1075
|
+
if (message.projectId !== "") {
|
|
1076
|
+
obj.projectId = message.projectId;
|
|
1077
|
+
}
|
|
1078
|
+
if (message.filter !== "") {
|
|
1079
|
+
obj.filter = message.filter;
|
|
1080
|
+
}
|
|
1081
|
+
if (message.timeRange !== undefined) {
|
|
1082
|
+
obj.timeRange = TimeRange.toJSON(message.timeRange);
|
|
1083
|
+
}
|
|
1084
|
+
if (message.timeInterval !== 0) {
|
|
1085
|
+
obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
|
|
1086
|
+
}
|
|
1087
|
+
return obj;
|
|
1088
|
+
},
|
|
1089
|
+
|
|
1090
|
+
create<I extends Exact<DeepPartial<StreamLogHistogramRequest>, I>>(base?: I): StreamLogHistogramRequest {
|
|
1091
|
+
return StreamLogHistogramRequest.fromPartial(base ?? ({} as any));
|
|
1092
|
+
},
|
|
1093
|
+
fromPartial<I extends Exact<DeepPartial<StreamLogHistogramRequest>, I>>(object: I): StreamLogHistogramRequest {
|
|
1094
|
+
const message = createBaseStreamLogHistogramRequest();
|
|
1095
|
+
message.organizationId = object.organizationId ?? "";
|
|
1096
|
+
message.projectId = object.projectId ?? "";
|
|
1097
|
+
message.filter = object.filter ?? "";
|
|
1098
|
+
message.timeRange = (object.timeRange !== undefined && object.timeRange !== null)
|
|
1099
|
+
? TimeRange.fromPartial(object.timeRange)
|
|
1100
|
+
: undefined;
|
|
1101
|
+
message.timeInterval = object.timeInterval ?? 0;
|
|
1102
|
+
return message;
|
|
1103
|
+
},
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
function createBaseLogHistogramEnvelope(): LogHistogramEnvelope {
|
|
1107
|
+
return { snapshot: undefined };
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
export const LogHistogramEnvelope: MessageFns<LogHistogramEnvelope> = {
|
|
1111
|
+
encode(message: LogHistogramEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1112
|
+
if (message.snapshot !== undefined) {
|
|
1113
|
+
LogHistogramSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
|
|
1114
|
+
}
|
|
1115
|
+
return writer;
|
|
1116
|
+
},
|
|
1117
|
+
|
|
1118
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogHistogramEnvelope {
|
|
1119
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1120
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1121
|
+
const message = createBaseLogHistogramEnvelope();
|
|
1122
|
+
while (reader.pos < end) {
|
|
1123
|
+
const tag = reader.uint32();
|
|
1124
|
+
switch (tag >>> 3) {
|
|
1125
|
+
case 1: {
|
|
1126
|
+
if (tag !== 10) {
|
|
1127
|
+
break;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
message.snapshot = LogHistogramSnapshot.decode(reader, reader.uint32());
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1135
|
+
break;
|
|
1136
|
+
}
|
|
1137
|
+
reader.skip(tag & 7);
|
|
1138
|
+
}
|
|
1139
|
+
return message;
|
|
1140
|
+
},
|
|
1141
|
+
|
|
1142
|
+
fromJSON(object: any): LogHistogramEnvelope {
|
|
1143
|
+
return { snapshot: isSet(object.snapshot) ? LogHistogramSnapshot.fromJSON(object.snapshot) : undefined };
|
|
1144
|
+
},
|
|
1145
|
+
|
|
1146
|
+
toJSON(message: LogHistogramEnvelope): unknown {
|
|
1147
|
+
const obj: any = {};
|
|
1148
|
+
if (message.snapshot !== undefined) {
|
|
1149
|
+
obj.snapshot = LogHistogramSnapshot.toJSON(message.snapshot);
|
|
1150
|
+
}
|
|
1151
|
+
return obj;
|
|
1152
|
+
},
|
|
1153
|
+
|
|
1154
|
+
create<I extends Exact<DeepPartial<LogHistogramEnvelope>, I>>(base?: I): LogHistogramEnvelope {
|
|
1155
|
+
return LogHistogramEnvelope.fromPartial(base ?? ({} as any));
|
|
1156
|
+
},
|
|
1157
|
+
fromPartial<I extends Exact<DeepPartial<LogHistogramEnvelope>, I>>(object: I): LogHistogramEnvelope {
|
|
1158
|
+
const message = createBaseLogHistogramEnvelope();
|
|
1159
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
1160
|
+
? LogHistogramSnapshot.fromPartial(object.snapshot)
|
|
1161
|
+
: undefined;
|
|
1162
|
+
return message;
|
|
1163
|
+
},
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1166
|
+
function createBaseLogHistogramSnapshot(): LogHistogramSnapshot {
|
|
1167
|
+
return { buckets: [], rangeStart: undefined, rangeEnd: undefined, bucketSizeMs: 0, expectedBucketCount: 0 };
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
export const LogHistogramSnapshot: MessageFns<LogHistogramSnapshot> = {
|
|
1171
|
+
encode(message: LogHistogramSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1172
|
+
for (const v of message.buckets) {
|
|
1173
|
+
LogHistogramBucket.encode(v!, writer.uint32(10).fork()).join();
|
|
1174
|
+
}
|
|
1175
|
+
if (message.rangeStart !== undefined) {
|
|
1176
|
+
Timestamp.encode(toTimestamp(message.rangeStart), writer.uint32(18).fork()).join();
|
|
1177
|
+
}
|
|
1178
|
+
if (message.rangeEnd !== undefined) {
|
|
1179
|
+
Timestamp.encode(toTimestamp(message.rangeEnd), writer.uint32(26).fork()).join();
|
|
1180
|
+
}
|
|
1181
|
+
if (message.bucketSizeMs !== 0) {
|
|
1182
|
+
writer.uint32(32).int64(message.bucketSizeMs);
|
|
1183
|
+
}
|
|
1184
|
+
if (message.expectedBucketCount !== 0) {
|
|
1185
|
+
writer.uint32(40).int32(message.expectedBucketCount);
|
|
1186
|
+
}
|
|
1187
|
+
return writer;
|
|
1188
|
+
},
|
|
1189
|
+
|
|
1190
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogHistogramSnapshot {
|
|
1191
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1192
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1193
|
+
const message = createBaseLogHistogramSnapshot();
|
|
1194
|
+
while (reader.pos < end) {
|
|
1195
|
+
const tag = reader.uint32();
|
|
1196
|
+
switch (tag >>> 3) {
|
|
1197
|
+
case 1: {
|
|
1198
|
+
if (tag !== 10) {
|
|
1199
|
+
break;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
message.buckets.push(LogHistogramBucket.decode(reader, reader.uint32()));
|
|
1203
|
+
continue;
|
|
1204
|
+
}
|
|
1205
|
+
case 2: {
|
|
1206
|
+
if (tag !== 18) {
|
|
1207
|
+
break;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
message.rangeStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1211
|
+
continue;
|
|
1212
|
+
}
|
|
1213
|
+
case 3: {
|
|
1214
|
+
if (tag !== 26) {
|
|
1215
|
+
break;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
message.rangeEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
case 4: {
|
|
1222
|
+
if (tag !== 32) {
|
|
1223
|
+
break;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
message.bucketSizeMs = longToNumber(reader.int64());
|
|
1227
|
+
continue;
|
|
1228
|
+
}
|
|
1229
|
+
case 5: {
|
|
1230
|
+
if (tag !== 40) {
|
|
1231
|
+
break;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
message.expectedBucketCount = reader.int32();
|
|
1235
|
+
continue;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1239
|
+
break;
|
|
1240
|
+
}
|
|
1241
|
+
reader.skip(tag & 7);
|
|
1242
|
+
}
|
|
1243
|
+
return message;
|
|
1244
|
+
},
|
|
1245
|
+
|
|
1246
|
+
fromJSON(object: any): LogHistogramSnapshot {
|
|
1247
|
+
return {
|
|
1248
|
+
buckets: globalThis.Array.isArray(object?.buckets)
|
|
1249
|
+
? object.buckets.map((e: any) => LogHistogramBucket.fromJSON(e))
|
|
1250
|
+
: [],
|
|
1251
|
+
rangeStart: isSet(object.rangeStart)
|
|
1252
|
+
? fromJsonTimestamp(object.rangeStart)
|
|
1253
|
+
: isSet(object.range_start)
|
|
1254
|
+
? fromJsonTimestamp(object.range_start)
|
|
1255
|
+
: undefined,
|
|
1256
|
+
rangeEnd: isSet(object.rangeEnd)
|
|
1257
|
+
? fromJsonTimestamp(object.rangeEnd)
|
|
1258
|
+
: isSet(object.range_end)
|
|
1259
|
+
? fromJsonTimestamp(object.range_end)
|
|
1260
|
+
: undefined,
|
|
1261
|
+
bucketSizeMs: isSet(object.bucketSizeMs)
|
|
1262
|
+
? globalThis.Number(object.bucketSizeMs)
|
|
1263
|
+
: isSet(object.bucket_size_ms)
|
|
1264
|
+
? globalThis.Number(object.bucket_size_ms)
|
|
1265
|
+
: 0,
|
|
1266
|
+
expectedBucketCount: isSet(object.expectedBucketCount)
|
|
1267
|
+
? globalThis.Number(object.expectedBucketCount)
|
|
1268
|
+
: isSet(object.expected_bucket_count)
|
|
1269
|
+
? globalThis.Number(object.expected_bucket_count)
|
|
1270
|
+
: 0,
|
|
1271
|
+
};
|
|
1272
|
+
},
|
|
1273
|
+
|
|
1274
|
+
toJSON(message: LogHistogramSnapshot): unknown {
|
|
1275
|
+
const obj: any = {};
|
|
1276
|
+
if (message.buckets?.length) {
|
|
1277
|
+
obj.buckets = message.buckets.map((e) => LogHistogramBucket.toJSON(e));
|
|
1278
|
+
}
|
|
1279
|
+
if (message.rangeStart !== undefined) {
|
|
1280
|
+
obj.rangeStart = message.rangeStart.toISOString();
|
|
1281
|
+
}
|
|
1282
|
+
if (message.rangeEnd !== undefined) {
|
|
1283
|
+
obj.rangeEnd = message.rangeEnd.toISOString();
|
|
1284
|
+
}
|
|
1285
|
+
if (message.bucketSizeMs !== 0) {
|
|
1286
|
+
obj.bucketSizeMs = Math.round(message.bucketSizeMs);
|
|
1287
|
+
}
|
|
1288
|
+
if (message.expectedBucketCount !== 0) {
|
|
1289
|
+
obj.expectedBucketCount = Math.round(message.expectedBucketCount);
|
|
1290
|
+
}
|
|
1291
|
+
return obj;
|
|
1292
|
+
},
|
|
1293
|
+
|
|
1294
|
+
create<I extends Exact<DeepPartial<LogHistogramSnapshot>, I>>(base?: I): LogHistogramSnapshot {
|
|
1295
|
+
return LogHistogramSnapshot.fromPartial(base ?? ({} as any));
|
|
1296
|
+
},
|
|
1297
|
+
fromPartial<I extends Exact<DeepPartial<LogHistogramSnapshot>, I>>(object: I): LogHistogramSnapshot {
|
|
1298
|
+
const message = createBaseLogHistogramSnapshot();
|
|
1299
|
+
message.buckets = object.buckets?.map((e) => LogHistogramBucket.fromPartial(e)) || [];
|
|
1300
|
+
message.rangeStart = object.rangeStart ?? undefined;
|
|
1301
|
+
message.rangeEnd = object.rangeEnd ?? undefined;
|
|
1302
|
+
message.bucketSizeMs = object.bucketSizeMs ?? 0;
|
|
1303
|
+
message.expectedBucketCount = object.expectedBucketCount ?? 0;
|
|
1304
|
+
return message;
|
|
1305
|
+
},
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
function createBaseLogHistogramBucket(): LogHistogramBucket {
|
|
1309
|
+
return { bucketStart: undefined, level: "", count: 0 };
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
export const LogHistogramBucket: MessageFns<LogHistogramBucket> = {
|
|
1313
|
+
encode(message: LogHistogramBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1314
|
+
if (message.bucketStart !== undefined) {
|
|
1315
|
+
Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
|
|
1316
|
+
}
|
|
1317
|
+
if (message.level !== "") {
|
|
1318
|
+
writer.uint32(18).string(message.level);
|
|
1319
|
+
}
|
|
1320
|
+
if (message.count !== 0) {
|
|
1321
|
+
writer.uint32(24).uint64(message.count);
|
|
1322
|
+
}
|
|
1323
|
+
return writer;
|
|
1324
|
+
},
|
|
1325
|
+
|
|
1326
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogHistogramBucket {
|
|
1327
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1328
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1329
|
+
const message = createBaseLogHistogramBucket();
|
|
1330
|
+
while (reader.pos < end) {
|
|
1331
|
+
const tag = reader.uint32();
|
|
1332
|
+
switch (tag >>> 3) {
|
|
1333
|
+
case 1: {
|
|
1334
|
+
if (tag !== 10) {
|
|
1335
|
+
break;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1339
|
+
continue;
|
|
1340
|
+
}
|
|
1341
|
+
case 2: {
|
|
1342
|
+
if (tag !== 18) {
|
|
1343
|
+
break;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
message.level = reader.string();
|
|
1347
|
+
continue;
|
|
1348
|
+
}
|
|
1349
|
+
case 3: {
|
|
1350
|
+
if (tag !== 24) {
|
|
1351
|
+
break;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
message.count = longToNumber(reader.uint64());
|
|
1355
|
+
continue;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
reader.skip(tag & 7);
|
|
1362
|
+
}
|
|
1363
|
+
return message;
|
|
1364
|
+
},
|
|
1365
|
+
|
|
1366
|
+
fromJSON(object: any): LogHistogramBucket {
|
|
1367
|
+
return {
|
|
1368
|
+
bucketStart: isSet(object.bucketStart)
|
|
1369
|
+
? fromJsonTimestamp(object.bucketStart)
|
|
1370
|
+
: isSet(object.bucket_start)
|
|
1371
|
+
? fromJsonTimestamp(object.bucket_start)
|
|
1372
|
+
: undefined,
|
|
1373
|
+
level: isSet(object.level) ? globalThis.String(object.level) : "",
|
|
1374
|
+
count: isSet(object.count) ? globalThis.Number(object.count) : 0,
|
|
1375
|
+
};
|
|
1376
|
+
},
|
|
1377
|
+
|
|
1378
|
+
toJSON(message: LogHistogramBucket): unknown {
|
|
1379
|
+
const obj: any = {};
|
|
1380
|
+
if (message.bucketStart !== undefined) {
|
|
1381
|
+
obj.bucketStart = message.bucketStart.toISOString();
|
|
1382
|
+
}
|
|
1383
|
+
if (message.level !== "") {
|
|
1384
|
+
obj.level = message.level;
|
|
1385
|
+
}
|
|
1386
|
+
if (message.count !== 0) {
|
|
1387
|
+
obj.count = Math.round(message.count);
|
|
1388
|
+
}
|
|
1389
|
+
return obj;
|
|
1390
|
+
},
|
|
1391
|
+
|
|
1392
|
+
create<I extends Exact<DeepPartial<LogHistogramBucket>, I>>(base?: I): LogHistogramBucket {
|
|
1393
|
+
return LogHistogramBucket.fromPartial(base ?? ({} as any));
|
|
1394
|
+
},
|
|
1395
|
+
fromPartial<I extends Exact<DeepPartial<LogHistogramBucket>, I>>(object: I): LogHistogramBucket {
|
|
1396
|
+
const message = createBaseLogHistogramBucket();
|
|
1397
|
+
message.bucketStart = object.bucketStart ?? undefined;
|
|
1398
|
+
message.level = object.level ?? "";
|
|
1399
|
+
message.count = object.count ?? 0;
|
|
1400
|
+
return message;
|
|
1401
|
+
},
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
function createBaseStreamLogAttributesRequest(): StreamLogAttributesRequest {
|
|
1405
|
+
return { organizationId: "", projectId: "" };
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
export const StreamLogAttributesRequest: MessageFns<StreamLogAttributesRequest> = {
|
|
1409
|
+
encode(message: StreamLogAttributesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1410
|
+
if (message.organizationId !== "") {
|
|
1411
|
+
writer.uint32(10).string(message.organizationId);
|
|
1412
|
+
}
|
|
1413
|
+
if (message.projectId !== "") {
|
|
1414
|
+
writer.uint32(18).string(message.projectId);
|
|
1415
|
+
}
|
|
1416
|
+
return writer;
|
|
1417
|
+
},
|
|
1418
|
+
|
|
1419
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamLogAttributesRequest {
|
|
1420
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1421
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1422
|
+
const message = createBaseStreamLogAttributesRequest();
|
|
1423
|
+
while (reader.pos < end) {
|
|
1424
|
+
const tag = reader.uint32();
|
|
1425
|
+
switch (tag >>> 3) {
|
|
1426
|
+
case 1: {
|
|
1427
|
+
if (tag !== 10) {
|
|
1428
|
+
break;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
message.organizationId = reader.string();
|
|
1432
|
+
continue;
|
|
1433
|
+
}
|
|
1434
|
+
case 2: {
|
|
1435
|
+
if (tag !== 18) {
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
message.projectId = reader.string();
|
|
1440
|
+
continue;
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1444
|
+
break;
|
|
1445
|
+
}
|
|
1446
|
+
reader.skip(tag & 7);
|
|
1447
|
+
}
|
|
1448
|
+
return message;
|
|
1449
|
+
},
|
|
1450
|
+
|
|
1451
|
+
fromJSON(object: any): StreamLogAttributesRequest {
|
|
1452
|
+
return {
|
|
1453
|
+
organizationId: isSet(object.organizationId)
|
|
1454
|
+
? globalThis.String(object.organizationId)
|
|
1455
|
+
: isSet(object.organization_id)
|
|
1456
|
+
? globalThis.String(object.organization_id)
|
|
1457
|
+
: "",
|
|
1458
|
+
projectId: isSet(object.projectId)
|
|
1459
|
+
? globalThis.String(object.projectId)
|
|
1460
|
+
: isSet(object.project_id)
|
|
1461
|
+
? globalThis.String(object.project_id)
|
|
1462
|
+
: "",
|
|
1463
|
+
};
|
|
1464
|
+
},
|
|
1465
|
+
|
|
1466
|
+
toJSON(message: StreamLogAttributesRequest): unknown {
|
|
1467
|
+
const obj: any = {};
|
|
1468
|
+
if (message.organizationId !== "") {
|
|
1469
|
+
obj.organizationId = message.organizationId;
|
|
1470
|
+
}
|
|
1471
|
+
if (message.projectId !== "") {
|
|
1472
|
+
obj.projectId = message.projectId;
|
|
1473
|
+
}
|
|
1474
|
+
return obj;
|
|
1475
|
+
},
|
|
1476
|
+
|
|
1477
|
+
create<I extends Exact<DeepPartial<StreamLogAttributesRequest>, I>>(base?: I): StreamLogAttributesRequest {
|
|
1478
|
+
return StreamLogAttributesRequest.fromPartial(base ?? ({} as any));
|
|
1479
|
+
},
|
|
1480
|
+
fromPartial<I extends Exact<DeepPartial<StreamLogAttributesRequest>, I>>(object: I): StreamLogAttributesRequest {
|
|
1481
|
+
const message = createBaseStreamLogAttributesRequest();
|
|
1482
|
+
message.organizationId = object.organizationId ?? "";
|
|
1483
|
+
message.projectId = object.projectId ?? "";
|
|
1484
|
+
return message;
|
|
1485
|
+
},
|
|
1486
|
+
};
|
|
1487
|
+
|
|
1488
|
+
function createBaseLogAttributeEnvelope(): LogAttributeEnvelope {
|
|
1489
|
+
return { snapshot: undefined, added: undefined };
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
export const LogAttributeEnvelope: MessageFns<LogAttributeEnvelope> = {
|
|
1493
|
+
encode(message: LogAttributeEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1494
|
+
if (message.snapshot !== undefined) {
|
|
1495
|
+
LogAttributeSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
|
|
1496
|
+
}
|
|
1497
|
+
if (message.added !== undefined) {
|
|
1498
|
+
LogAttribute.encode(message.added, writer.uint32(18).fork()).join();
|
|
1499
|
+
}
|
|
1500
|
+
return writer;
|
|
1501
|
+
},
|
|
1502
|
+
|
|
1503
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogAttributeEnvelope {
|
|
1504
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1505
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1506
|
+
const message = createBaseLogAttributeEnvelope();
|
|
1507
|
+
while (reader.pos < end) {
|
|
1508
|
+
const tag = reader.uint32();
|
|
1509
|
+
switch (tag >>> 3) {
|
|
1510
|
+
case 1: {
|
|
1511
|
+
if (tag !== 10) {
|
|
1512
|
+
break;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
message.snapshot = LogAttributeSnapshot.decode(reader, reader.uint32());
|
|
1516
|
+
continue;
|
|
1517
|
+
}
|
|
1518
|
+
case 2: {
|
|
1519
|
+
if (tag !== 18) {
|
|
1520
|
+
break;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
message.added = LogAttribute.decode(reader, reader.uint32());
|
|
1524
|
+
continue;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1528
|
+
break;
|
|
1529
|
+
}
|
|
1530
|
+
reader.skip(tag & 7);
|
|
1531
|
+
}
|
|
1532
|
+
return message;
|
|
1533
|
+
},
|
|
1534
|
+
|
|
1535
|
+
fromJSON(object: any): LogAttributeEnvelope {
|
|
1536
|
+
return {
|
|
1537
|
+
snapshot: isSet(object.snapshot) ? LogAttributeSnapshot.fromJSON(object.snapshot) : undefined,
|
|
1538
|
+
added: isSet(object.added) ? LogAttribute.fromJSON(object.added) : undefined,
|
|
1539
|
+
};
|
|
1540
|
+
},
|
|
1541
|
+
|
|
1542
|
+
toJSON(message: LogAttributeEnvelope): unknown {
|
|
1543
|
+
const obj: any = {};
|
|
1544
|
+
if (message.snapshot !== undefined) {
|
|
1545
|
+
obj.snapshot = LogAttributeSnapshot.toJSON(message.snapshot);
|
|
1546
|
+
}
|
|
1547
|
+
if (message.added !== undefined) {
|
|
1548
|
+
obj.added = LogAttribute.toJSON(message.added);
|
|
1549
|
+
}
|
|
1550
|
+
return obj;
|
|
1551
|
+
},
|
|
1552
|
+
|
|
1553
|
+
create<I extends Exact<DeepPartial<LogAttributeEnvelope>, I>>(base?: I): LogAttributeEnvelope {
|
|
1554
|
+
return LogAttributeEnvelope.fromPartial(base ?? ({} as any));
|
|
1555
|
+
},
|
|
1556
|
+
fromPartial<I extends Exact<DeepPartial<LogAttributeEnvelope>, I>>(object: I): LogAttributeEnvelope {
|
|
1557
|
+
const message = createBaseLogAttributeEnvelope();
|
|
1558
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
1559
|
+
? LogAttributeSnapshot.fromPartial(object.snapshot)
|
|
1560
|
+
: undefined;
|
|
1561
|
+
message.added = (object.added !== undefined && object.added !== null)
|
|
1562
|
+
? LogAttribute.fromPartial(object.added)
|
|
1563
|
+
: undefined;
|
|
1564
|
+
return message;
|
|
1565
|
+
},
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
function createBaseLogAttributeSnapshot(): LogAttributeSnapshot {
|
|
1569
|
+
return { attributes: [] };
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
export const LogAttributeSnapshot: MessageFns<LogAttributeSnapshot> = {
|
|
1573
|
+
encode(message: LogAttributeSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1574
|
+
for (const v of message.attributes) {
|
|
1575
|
+
LogAttribute.encode(v!, writer.uint32(10).fork()).join();
|
|
1576
|
+
}
|
|
1577
|
+
return writer;
|
|
1578
|
+
},
|
|
1579
|
+
|
|
1580
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogAttributeSnapshot {
|
|
1581
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1582
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1583
|
+
const message = createBaseLogAttributeSnapshot();
|
|
1584
|
+
while (reader.pos < end) {
|
|
1585
|
+
const tag = reader.uint32();
|
|
1586
|
+
switch (tag >>> 3) {
|
|
1587
|
+
case 1: {
|
|
1588
|
+
if (tag !== 10) {
|
|
1589
|
+
break;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
message.attributes.push(LogAttribute.decode(reader, reader.uint32()));
|
|
1593
|
+
continue;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1597
|
+
break;
|
|
1598
|
+
}
|
|
1599
|
+
reader.skip(tag & 7);
|
|
1600
|
+
}
|
|
1601
|
+
return message;
|
|
1602
|
+
},
|
|
1603
|
+
|
|
1604
|
+
fromJSON(object: any): LogAttributeSnapshot {
|
|
1605
|
+
return {
|
|
1606
|
+
attributes: globalThis.Array.isArray(object?.attributes)
|
|
1607
|
+
? object.attributes.map((e: any) => LogAttribute.fromJSON(e))
|
|
1608
|
+
: [],
|
|
1609
|
+
};
|
|
1610
|
+
},
|
|
1611
|
+
|
|
1612
|
+
toJSON(message: LogAttributeSnapshot): unknown {
|
|
1613
|
+
const obj: any = {};
|
|
1614
|
+
if (message.attributes?.length) {
|
|
1615
|
+
obj.attributes = message.attributes.map((e) => LogAttribute.toJSON(e));
|
|
1616
|
+
}
|
|
1617
|
+
return obj;
|
|
1618
|
+
},
|
|
1619
|
+
|
|
1620
|
+
create<I extends Exact<DeepPartial<LogAttributeSnapshot>, I>>(base?: I): LogAttributeSnapshot {
|
|
1621
|
+
return LogAttributeSnapshot.fromPartial(base ?? ({} as any));
|
|
1622
|
+
},
|
|
1623
|
+
fromPartial<I extends Exact<DeepPartial<LogAttributeSnapshot>, I>>(object: I): LogAttributeSnapshot {
|
|
1624
|
+
const message = createBaseLogAttributeSnapshot();
|
|
1625
|
+
message.attributes = object.attributes?.map((e) => LogAttribute.fromPartial(e)) || [];
|
|
1626
|
+
return message;
|
|
1627
|
+
},
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
function createBaseLogAttribute(): LogAttribute {
|
|
1631
|
+
return { key: "", values: [] };
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
export const LogAttribute: MessageFns<LogAttribute> = {
|
|
1635
|
+
encode(message: LogAttribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1636
|
+
if (message.key !== "") {
|
|
1637
|
+
writer.uint32(10).string(message.key);
|
|
1638
|
+
}
|
|
1639
|
+
for (const v of message.values) {
|
|
1640
|
+
writer.uint32(18).string(v!);
|
|
1641
|
+
}
|
|
1642
|
+
return writer;
|
|
1643
|
+
},
|
|
1644
|
+
|
|
1645
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LogAttribute {
|
|
1646
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1647
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1648
|
+
const message = createBaseLogAttribute();
|
|
1649
|
+
while (reader.pos < end) {
|
|
1650
|
+
const tag = reader.uint32();
|
|
1651
|
+
switch (tag >>> 3) {
|
|
1652
|
+
case 1: {
|
|
1653
|
+
if (tag !== 10) {
|
|
1654
|
+
break;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
message.key = reader.string();
|
|
1658
|
+
continue;
|
|
1659
|
+
}
|
|
1660
|
+
case 2: {
|
|
1661
|
+
if (tag !== 18) {
|
|
1662
|
+
break;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
message.values.push(reader.string());
|
|
1666
|
+
continue;
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1670
|
+
break;
|
|
1671
|
+
}
|
|
1672
|
+
reader.skip(tag & 7);
|
|
1673
|
+
}
|
|
1674
|
+
return message;
|
|
1675
|
+
},
|
|
1676
|
+
|
|
1677
|
+
fromJSON(object: any): LogAttribute {
|
|
1678
|
+
return {
|
|
1679
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
1680
|
+
values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
|
|
1681
|
+
};
|
|
1682
|
+
},
|
|
1683
|
+
|
|
1684
|
+
toJSON(message: LogAttribute): unknown {
|
|
1685
|
+
const obj: any = {};
|
|
1686
|
+
if (message.key !== "") {
|
|
1687
|
+
obj.key = message.key;
|
|
1688
|
+
}
|
|
1689
|
+
if (message.values?.length) {
|
|
1690
|
+
obj.values = message.values;
|
|
1691
|
+
}
|
|
1692
|
+
return obj;
|
|
1693
|
+
},
|
|
1694
|
+
|
|
1695
|
+
create<I extends Exact<DeepPartial<LogAttribute>, I>>(base?: I): LogAttribute {
|
|
1696
|
+
return LogAttribute.fromPartial(base ?? ({} as any));
|
|
1697
|
+
},
|
|
1698
|
+
fromPartial<I extends Exact<DeepPartial<LogAttribute>, I>>(object: I): LogAttribute {
|
|
1699
|
+
const message = createBaseLogAttribute();
|
|
1700
|
+
message.key = object.key ?? "";
|
|
1701
|
+
message.values = object.values?.map((e) => e) || [];
|
|
1702
|
+
return message;
|
|
1703
|
+
},
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
/**
|
|
1707
|
+
* LogGatewayService is the web surface of telemetry.api.v1 LogService — the
|
|
1708
|
+
* types are domain-isolated copies converted in gateways/internal/convert.
|
|
1709
|
+
* One AIP-160 filter string drives log search with live tail and the severity
|
|
1710
|
+
* histogram over the same filter; the attribute catalog feeds filter-building
|
|
1711
|
+
* autocomplete.
|
|
1712
|
+
*/
|
|
1713
|
+
export interface LogGatewayService {
|
|
1714
|
+
/**
|
|
1715
|
+
* Log search: a snapshot of the newest matching records, then — for
|
|
1716
|
+
* relative ranges — a live tail of newly-ingested matches while the stream
|
|
1717
|
+
* stays open. Absolute ranges complete after the snapshot.
|
|
1718
|
+
*/
|
|
1719
|
+
StreamLogs(request: StreamLogsRequest, metadata?: Metadata): Observable<LogDataEnvelope>;
|
|
1720
|
+
/**
|
|
1721
|
+
* Bucketed severity-level counts for the same filter. Relative ranges
|
|
1722
|
+
* re-emit a full snapshot on each tick; absolute ranges complete after one.
|
|
1723
|
+
*/
|
|
1724
|
+
StreamLogHistogram(request: StreamLogHistogramRequest, metadata?: Metadata): Observable<LogHistogramEnvelope>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Live attribute catalog for the project's logs: a snapshot of attribute
|
|
1727
|
+
* keys with sampled observed values (last 24h), then each newly-observed
|
|
1728
|
+
* key as an addition on a poll ticker.
|
|
1729
|
+
*/
|
|
1730
|
+
StreamLogAttributes(request: StreamLogAttributesRequest, metadata?: Metadata): Observable<LogAttributeEnvelope>;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
export const LogGatewayServiceServiceName = "gateway.web.v1.LogGatewayService";
|
|
1734
|
+
export class LogGatewayServiceClientImpl implements LogGatewayService {
|
|
1735
|
+
private readonly rpc: Rpc;
|
|
1736
|
+
private readonly service: string;
|
|
1737
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
1738
|
+
this.service = opts?.service || LogGatewayServiceServiceName;
|
|
1739
|
+
this.rpc = rpc;
|
|
1740
|
+
this.StreamLogs = this.StreamLogs.bind(this);
|
|
1741
|
+
this.StreamLogHistogram = this.StreamLogHistogram.bind(this);
|
|
1742
|
+
this.StreamLogAttributes = this.StreamLogAttributes.bind(this);
|
|
1743
|
+
}
|
|
1744
|
+
StreamLogs(request: StreamLogsRequest, metadata?: Metadata): Observable<LogDataEnvelope> {
|
|
1745
|
+
const data = StreamLogsRequest.encode(request).finish();
|
|
1746
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamLogs", data, metadata);
|
|
1747
|
+
return result.pipe(map((data) => LogDataEnvelope.decode(new BinaryReader(data))));
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
StreamLogHistogram(request: StreamLogHistogramRequest, metadata?: Metadata): Observable<LogHistogramEnvelope> {
|
|
1751
|
+
const data = StreamLogHistogramRequest.encode(request).finish();
|
|
1752
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamLogHistogram", data, metadata);
|
|
1753
|
+
return result.pipe(map((data) => LogHistogramEnvelope.decode(new BinaryReader(data))));
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
StreamLogAttributes(request: StreamLogAttributesRequest, metadata?: Metadata): Observable<LogAttributeEnvelope> {
|
|
1757
|
+
const data = StreamLogAttributesRequest.encode(request).finish();
|
|
1758
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamLogAttributes", data, metadata);
|
|
1759
|
+
return result.pipe(map((data) => LogAttributeEnvelope.decode(new BinaryReader(data))));
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
interface Rpc {
|
|
1764
|
+
request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
|
|
1765
|
+
clientStreamingRequest(
|
|
1766
|
+
service: string,
|
|
1767
|
+
method: string,
|
|
1768
|
+
data: Observable<Uint8Array>,
|
|
1769
|
+
metadata?: Metadata,
|
|
1770
|
+
): Promise<Uint8Array>;
|
|
1771
|
+
serverStreamingRequest(
|
|
1772
|
+
service: string,
|
|
1773
|
+
method: string,
|
|
1774
|
+
data: Uint8Array,
|
|
1775
|
+
metadata?: Metadata,
|
|
1776
|
+
): Observable<Uint8Array>;
|
|
1777
|
+
bidirectionalStreamingRequest(
|
|
1778
|
+
service: string,
|
|
1779
|
+
method: string,
|
|
1780
|
+
data: Observable<Uint8Array>,
|
|
1781
|
+
metadata?: Metadata,
|
|
1782
|
+
): Observable<Uint8Array>;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1786
|
+
|
|
1787
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
1788
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
1789
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
1790
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
1791
|
+
: Partial<T>;
|
|
1792
|
+
|
|
1793
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
1794
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
1795
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
1796
|
+
|
|
1797
|
+
function toTimestamp(date: Date): Timestamp {
|
|
1798
|
+
const seconds = Math.trunc(date.getTime() / 1_000);
|
|
1799
|
+
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
1800
|
+
return { seconds, nanos };
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
function fromTimestamp(t: Timestamp): Date {
|
|
1804
|
+
let millis = (t.seconds || 0) * 1_000;
|
|
1805
|
+
millis += (t.nanos || 0) / 1_000_000;
|
|
1806
|
+
return new globalThis.Date(millis);
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
function fromJsonTimestamp(o: any): Date {
|
|
1810
|
+
if (o instanceof globalThis.Date) {
|
|
1811
|
+
return o;
|
|
1812
|
+
} else if (typeof o === "string") {
|
|
1813
|
+
return new globalThis.Date(o);
|
|
1814
|
+
} else {
|
|
1815
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
1820
|
+
const num = globalThis.Number(int64.toString());
|
|
1821
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
1822
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1823
|
+
}
|
|
1824
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
1825
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
1826
|
+
}
|
|
1827
|
+
return num;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
function isObject(value: any): boolean {
|
|
1831
|
+
return typeof value === "object" && value !== null;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
function isSet(value: any): boolean {
|
|
1835
|
+
return value !== null && value !== undefined;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
export interface MessageFns<T> {
|
|
1839
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
1840
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
1841
|
+
fromJSON(object: any): T;
|
|
1842
|
+
toJSON(message: T): unknown;
|
|
1843
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
1844
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
1845
|
+
}
|