@miradorlabs/web-grpc 2.15.0 → 2.16.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,2907 @@
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/rule_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 { ResponseStatus } from "../../common/v1/status";
14
+ import { EnabledStatus, enabledStatusFromJSON, enabledStatusToJSON } from "./common";
15
+
16
+ export const protobufPackage = "gateway.web.v1";
17
+
18
+ export interface TraceRule {
19
+ id: string;
20
+ projectId: string;
21
+ name: string;
22
+ description: string;
23
+ enabled: EnabledStatus;
24
+ integrationIds: string[];
25
+ celExpression: string;
26
+ createdAt: Date | undefined;
27
+ updatedAt: Date | undefined;
28
+ }
29
+
30
+ export interface CreateTraceRuleRequest {
31
+ projectId: string;
32
+ name: string;
33
+ description: string;
34
+ integrationIds: string[];
35
+ celExpression: string;
36
+ organizationId: string;
37
+ }
38
+
39
+ export interface CreateTraceRuleResponse {
40
+ status: ResponseStatus | undefined;
41
+ rule: TraceRule | undefined;
42
+ }
43
+
44
+ export interface GetTraceRuleRequest {
45
+ projectId: string;
46
+ ruleId: string;
47
+ organizationId: string;
48
+ }
49
+
50
+ export interface GetTraceRuleResponse {
51
+ status: ResponseStatus | undefined;
52
+ rule: TraceRule | undefined;
53
+ }
54
+
55
+ export interface ListTraceRulesRequest {
56
+ organizationId: string;
57
+ organizationIdFilter?: string | undefined;
58
+ projectIdFilter?: string | undefined;
59
+ }
60
+
61
+ export interface ListTraceRulesResponse {
62
+ status: ResponseStatus | undefined;
63
+ rules: TraceRule[];
64
+ }
65
+
66
+ export interface UpdateTraceRuleRequest {
67
+ projectId: string;
68
+ ruleId: string;
69
+ updates: UpdateTraceRuleRequest_TraceRuleUpdates | undefined;
70
+ organizationId: string;
71
+ }
72
+
73
+ export interface UpdateTraceRuleRequest_IntegrationIds {
74
+ ids: string[];
75
+ }
76
+
77
+ export interface UpdateTraceRuleRequest_CelExpression {
78
+ celExpression: string;
79
+ }
80
+
81
+ export interface UpdateTraceRuleRequest_TraceRuleUpdates {
82
+ name?: string | undefined;
83
+ description?: string | undefined;
84
+ enabled?: EnabledStatus | undefined;
85
+ integrationIds: UpdateTraceRuleRequest_IntegrationIds | undefined;
86
+ celExpression: UpdateTraceRuleRequest_CelExpression | undefined;
87
+ }
88
+
89
+ export interface UpdateTraceRuleResponse {
90
+ status: ResponseStatus | undefined;
91
+ rule: TraceRule | undefined;
92
+ }
93
+
94
+ export interface DeleteTraceRuleRequest {
95
+ projectId: string;
96
+ ruleId: string;
97
+ organizationId: string;
98
+ }
99
+
100
+ export interface DeleteTraceRuleResponse {
101
+ status: ResponseStatus | undefined;
102
+ }
103
+
104
+ export interface StreamTraceRuleSimulationRequest {
105
+ projectId: string;
106
+ celExpression: string;
107
+ limit: number;
108
+ organizationId: string;
109
+ }
110
+
111
+ export interface TraceRuleSimulationMatch {
112
+ traceId: string;
113
+ traceName: string;
114
+ matchReason: string;
115
+ createdAt: Date | undefined;
116
+ }
117
+
118
+ export interface ListTraceRuleSchemasRequest {
119
+ organizationId: string;
120
+ }
121
+
122
+ export interface ListTraceRuleSchemasResponse {
123
+ status: ResponseStatus | undefined;
124
+ schemas: TraceRuleSchema[];
125
+ }
126
+
127
+ export interface TraceRuleSchema {
128
+ id: string;
129
+ label: string;
130
+ rootVariable: string;
131
+ jsonSchema: string;
132
+ }
133
+
134
+ export interface StreamTraceRuleMatchesRequest {
135
+ projectId: string;
136
+ organizationId: string;
137
+ limit: number;
138
+ }
139
+
140
+ export interface TraceRuleMatchEnvelope {
141
+ snapshot?: TraceRuleMatchSnapshot | undefined;
142
+ update?: TraceRuleMatchEvent | undefined;
143
+ }
144
+
145
+ export interface TraceRuleMatchSnapshot {
146
+ matches: TraceRuleMatchEvent[];
147
+ }
148
+
149
+ export interface TraceRuleMatchEvent {
150
+ matchId: string;
151
+ projectId: string;
152
+ ruleId: string;
153
+ ruleName: string;
154
+ integrationIds: string[];
155
+ matchReason: string;
156
+ createdAt: Date | undefined;
157
+ entityContexts: TraceRuleMatchEvent_EntityContext[];
158
+ }
159
+
160
+ /** EntityContext carries contextual data about a matched entity. */
161
+ export interface TraceRuleMatchEvent_EntityContext {
162
+ traceContext?: TraceRuleMatchEvent_EntityContext_TraceContext | undefined;
163
+ }
164
+
165
+ export interface TraceRuleMatchEvent_EntityContext_TraceContext {
166
+ traceId: string;
167
+ }
168
+
169
+ function createBaseTraceRule(): TraceRule {
170
+ return {
171
+ id: "",
172
+ projectId: "",
173
+ name: "",
174
+ description: "",
175
+ enabled: 0,
176
+ integrationIds: [],
177
+ celExpression: "",
178
+ createdAt: undefined,
179
+ updatedAt: undefined,
180
+ };
181
+ }
182
+
183
+ export const TraceRule: MessageFns<TraceRule> = {
184
+ encode(message: TraceRule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
185
+ if (message.id !== "") {
186
+ writer.uint32(10).string(message.id);
187
+ }
188
+ if (message.projectId !== "") {
189
+ writer.uint32(18).string(message.projectId);
190
+ }
191
+ if (message.name !== "") {
192
+ writer.uint32(26).string(message.name);
193
+ }
194
+ if (message.description !== "") {
195
+ writer.uint32(34).string(message.description);
196
+ }
197
+ if (message.enabled !== 0) {
198
+ writer.uint32(40).int32(message.enabled);
199
+ }
200
+ for (const v of message.integrationIds) {
201
+ writer.uint32(50).string(v!);
202
+ }
203
+ if (message.celExpression !== "") {
204
+ writer.uint32(58).string(message.celExpression);
205
+ }
206
+ if (message.createdAt !== undefined) {
207
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(66).fork()).join();
208
+ }
209
+ if (message.updatedAt !== undefined) {
210
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(74).fork()).join();
211
+ }
212
+ return writer;
213
+ },
214
+
215
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRule {
216
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
217
+ const end = length === undefined ? reader.len : reader.pos + length;
218
+ const message = createBaseTraceRule();
219
+ while (reader.pos < end) {
220
+ const tag = reader.uint32();
221
+ switch (tag >>> 3) {
222
+ case 1: {
223
+ if (tag !== 10) {
224
+ break;
225
+ }
226
+
227
+ message.id = reader.string();
228
+ continue;
229
+ }
230
+ case 2: {
231
+ if (tag !== 18) {
232
+ break;
233
+ }
234
+
235
+ message.projectId = reader.string();
236
+ continue;
237
+ }
238
+ case 3: {
239
+ if (tag !== 26) {
240
+ break;
241
+ }
242
+
243
+ message.name = reader.string();
244
+ continue;
245
+ }
246
+ case 4: {
247
+ if (tag !== 34) {
248
+ break;
249
+ }
250
+
251
+ message.description = reader.string();
252
+ continue;
253
+ }
254
+ case 5: {
255
+ if (tag !== 40) {
256
+ break;
257
+ }
258
+
259
+ message.enabled = reader.int32() as any;
260
+ continue;
261
+ }
262
+ case 6: {
263
+ if (tag !== 50) {
264
+ break;
265
+ }
266
+
267
+ message.integrationIds.push(reader.string());
268
+ continue;
269
+ }
270
+ case 7: {
271
+ if (tag !== 58) {
272
+ break;
273
+ }
274
+
275
+ message.celExpression = reader.string();
276
+ continue;
277
+ }
278
+ case 8: {
279
+ if (tag !== 66) {
280
+ break;
281
+ }
282
+
283
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
284
+ continue;
285
+ }
286
+ case 9: {
287
+ if (tag !== 74) {
288
+ break;
289
+ }
290
+
291
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
292
+ continue;
293
+ }
294
+ }
295
+ if ((tag & 7) === 4 || tag === 0) {
296
+ break;
297
+ }
298
+ reader.skip(tag & 7);
299
+ }
300
+ return message;
301
+ },
302
+
303
+ fromJSON(object: any): TraceRule {
304
+ return {
305
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
306
+ projectId: isSet(object.projectId)
307
+ ? globalThis.String(object.projectId)
308
+ : isSet(object.project_id)
309
+ ? globalThis.String(object.project_id)
310
+ : "",
311
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
312
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
313
+ enabled: isSet(object.enabled) ? enabledStatusFromJSON(object.enabled) : 0,
314
+ integrationIds: globalThis.Array.isArray(object?.integrationIds)
315
+ ? object.integrationIds.map((e: any) => globalThis.String(e))
316
+ : globalThis.Array.isArray(object?.integration_ids)
317
+ ? object.integration_ids.map((e: any) => globalThis.String(e))
318
+ : [],
319
+ celExpression: isSet(object.celExpression)
320
+ ? globalThis.String(object.celExpression)
321
+ : isSet(object.cel_expression)
322
+ ? globalThis.String(object.cel_expression)
323
+ : "",
324
+ createdAt: isSet(object.createdAt)
325
+ ? fromJsonTimestamp(object.createdAt)
326
+ : isSet(object.created_at)
327
+ ? fromJsonTimestamp(object.created_at)
328
+ : undefined,
329
+ updatedAt: isSet(object.updatedAt)
330
+ ? fromJsonTimestamp(object.updatedAt)
331
+ : isSet(object.updated_at)
332
+ ? fromJsonTimestamp(object.updated_at)
333
+ : undefined,
334
+ };
335
+ },
336
+
337
+ toJSON(message: TraceRule): unknown {
338
+ const obj: any = {};
339
+ if (message.id !== "") {
340
+ obj.id = message.id;
341
+ }
342
+ if (message.projectId !== "") {
343
+ obj.projectId = message.projectId;
344
+ }
345
+ if (message.name !== "") {
346
+ obj.name = message.name;
347
+ }
348
+ if (message.description !== "") {
349
+ obj.description = message.description;
350
+ }
351
+ if (message.enabled !== 0) {
352
+ obj.enabled = enabledStatusToJSON(message.enabled);
353
+ }
354
+ if (message.integrationIds?.length) {
355
+ obj.integrationIds = message.integrationIds;
356
+ }
357
+ if (message.celExpression !== "") {
358
+ obj.celExpression = message.celExpression;
359
+ }
360
+ if (message.createdAt !== undefined) {
361
+ obj.createdAt = message.createdAt.toISOString();
362
+ }
363
+ if (message.updatedAt !== undefined) {
364
+ obj.updatedAt = message.updatedAt.toISOString();
365
+ }
366
+ return obj;
367
+ },
368
+
369
+ create<I extends Exact<DeepPartial<TraceRule>, I>>(base?: I): TraceRule {
370
+ return TraceRule.fromPartial(base ?? ({} as any));
371
+ },
372
+ fromPartial<I extends Exact<DeepPartial<TraceRule>, I>>(object: I): TraceRule {
373
+ const message = createBaseTraceRule();
374
+ message.id = object.id ?? "";
375
+ message.projectId = object.projectId ?? "";
376
+ message.name = object.name ?? "";
377
+ message.description = object.description ?? "";
378
+ message.enabled = object.enabled ?? 0;
379
+ message.integrationIds = object.integrationIds?.map((e) => e) || [];
380
+ message.celExpression = object.celExpression ?? "";
381
+ message.createdAt = object.createdAt ?? undefined;
382
+ message.updatedAt = object.updatedAt ?? undefined;
383
+ return message;
384
+ },
385
+ };
386
+
387
+ function createBaseCreateTraceRuleRequest(): CreateTraceRuleRequest {
388
+ return { projectId: "", name: "", description: "", integrationIds: [], celExpression: "", organizationId: "" };
389
+ }
390
+
391
+ export const CreateTraceRuleRequest: MessageFns<CreateTraceRuleRequest> = {
392
+ encode(message: CreateTraceRuleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
393
+ if (message.projectId !== "") {
394
+ writer.uint32(10).string(message.projectId);
395
+ }
396
+ if (message.name !== "") {
397
+ writer.uint32(18).string(message.name);
398
+ }
399
+ if (message.description !== "") {
400
+ writer.uint32(26).string(message.description);
401
+ }
402
+ for (const v of message.integrationIds) {
403
+ writer.uint32(34).string(v!);
404
+ }
405
+ if (message.celExpression !== "") {
406
+ writer.uint32(42).string(message.celExpression);
407
+ }
408
+ if (message.organizationId !== "") {
409
+ writer.uint32(50).string(message.organizationId);
410
+ }
411
+ return writer;
412
+ },
413
+
414
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateTraceRuleRequest {
415
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
416
+ const end = length === undefined ? reader.len : reader.pos + length;
417
+ const message = createBaseCreateTraceRuleRequest();
418
+ while (reader.pos < end) {
419
+ const tag = reader.uint32();
420
+ switch (tag >>> 3) {
421
+ case 1: {
422
+ if (tag !== 10) {
423
+ break;
424
+ }
425
+
426
+ message.projectId = reader.string();
427
+ continue;
428
+ }
429
+ case 2: {
430
+ if (tag !== 18) {
431
+ break;
432
+ }
433
+
434
+ message.name = reader.string();
435
+ continue;
436
+ }
437
+ case 3: {
438
+ if (tag !== 26) {
439
+ break;
440
+ }
441
+
442
+ message.description = reader.string();
443
+ continue;
444
+ }
445
+ case 4: {
446
+ if (tag !== 34) {
447
+ break;
448
+ }
449
+
450
+ message.integrationIds.push(reader.string());
451
+ continue;
452
+ }
453
+ case 5: {
454
+ if (tag !== 42) {
455
+ break;
456
+ }
457
+
458
+ message.celExpression = reader.string();
459
+ continue;
460
+ }
461
+ case 6: {
462
+ if (tag !== 50) {
463
+ break;
464
+ }
465
+
466
+ message.organizationId = reader.string();
467
+ continue;
468
+ }
469
+ }
470
+ if ((tag & 7) === 4 || tag === 0) {
471
+ break;
472
+ }
473
+ reader.skip(tag & 7);
474
+ }
475
+ return message;
476
+ },
477
+
478
+ fromJSON(object: any): CreateTraceRuleRequest {
479
+ return {
480
+ projectId: isSet(object.projectId)
481
+ ? globalThis.String(object.projectId)
482
+ : isSet(object.project_id)
483
+ ? globalThis.String(object.project_id)
484
+ : "",
485
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
486
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
487
+ integrationIds: globalThis.Array.isArray(object?.integrationIds)
488
+ ? object.integrationIds.map((e: any) => globalThis.String(e))
489
+ : globalThis.Array.isArray(object?.integration_ids)
490
+ ? object.integration_ids.map((e: any) => globalThis.String(e))
491
+ : [],
492
+ celExpression: isSet(object.celExpression)
493
+ ? globalThis.String(object.celExpression)
494
+ : isSet(object.cel_expression)
495
+ ? globalThis.String(object.cel_expression)
496
+ : "",
497
+ organizationId: isSet(object.organizationId)
498
+ ? globalThis.String(object.organizationId)
499
+ : isSet(object.organization_id)
500
+ ? globalThis.String(object.organization_id)
501
+ : "",
502
+ };
503
+ },
504
+
505
+ toJSON(message: CreateTraceRuleRequest): unknown {
506
+ const obj: any = {};
507
+ if (message.projectId !== "") {
508
+ obj.projectId = message.projectId;
509
+ }
510
+ if (message.name !== "") {
511
+ obj.name = message.name;
512
+ }
513
+ if (message.description !== "") {
514
+ obj.description = message.description;
515
+ }
516
+ if (message.integrationIds?.length) {
517
+ obj.integrationIds = message.integrationIds;
518
+ }
519
+ if (message.celExpression !== "") {
520
+ obj.celExpression = message.celExpression;
521
+ }
522
+ if (message.organizationId !== "") {
523
+ obj.organizationId = message.organizationId;
524
+ }
525
+ return obj;
526
+ },
527
+
528
+ create<I extends Exact<DeepPartial<CreateTraceRuleRequest>, I>>(base?: I): CreateTraceRuleRequest {
529
+ return CreateTraceRuleRequest.fromPartial(base ?? ({} as any));
530
+ },
531
+ fromPartial<I extends Exact<DeepPartial<CreateTraceRuleRequest>, I>>(object: I): CreateTraceRuleRequest {
532
+ const message = createBaseCreateTraceRuleRequest();
533
+ message.projectId = object.projectId ?? "";
534
+ message.name = object.name ?? "";
535
+ message.description = object.description ?? "";
536
+ message.integrationIds = object.integrationIds?.map((e) => e) || [];
537
+ message.celExpression = object.celExpression ?? "";
538
+ message.organizationId = object.organizationId ?? "";
539
+ return message;
540
+ },
541
+ };
542
+
543
+ function createBaseCreateTraceRuleResponse(): CreateTraceRuleResponse {
544
+ return { status: undefined, rule: undefined };
545
+ }
546
+
547
+ export const CreateTraceRuleResponse: MessageFns<CreateTraceRuleResponse> = {
548
+ encode(message: CreateTraceRuleResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
549
+ if (message.status !== undefined) {
550
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
551
+ }
552
+ if (message.rule !== undefined) {
553
+ TraceRule.encode(message.rule, writer.uint32(18).fork()).join();
554
+ }
555
+ return writer;
556
+ },
557
+
558
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateTraceRuleResponse {
559
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
560
+ const end = length === undefined ? reader.len : reader.pos + length;
561
+ const message = createBaseCreateTraceRuleResponse();
562
+ while (reader.pos < end) {
563
+ const tag = reader.uint32();
564
+ switch (tag >>> 3) {
565
+ case 1: {
566
+ if (tag !== 10) {
567
+ break;
568
+ }
569
+
570
+ message.status = ResponseStatus.decode(reader, reader.uint32());
571
+ continue;
572
+ }
573
+ case 2: {
574
+ if (tag !== 18) {
575
+ break;
576
+ }
577
+
578
+ message.rule = TraceRule.decode(reader, reader.uint32());
579
+ continue;
580
+ }
581
+ }
582
+ if ((tag & 7) === 4 || tag === 0) {
583
+ break;
584
+ }
585
+ reader.skip(tag & 7);
586
+ }
587
+ return message;
588
+ },
589
+
590
+ fromJSON(object: any): CreateTraceRuleResponse {
591
+ return {
592
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
593
+ rule: isSet(object.rule) ? TraceRule.fromJSON(object.rule) : undefined,
594
+ };
595
+ },
596
+
597
+ toJSON(message: CreateTraceRuleResponse): unknown {
598
+ const obj: any = {};
599
+ if (message.status !== undefined) {
600
+ obj.status = ResponseStatus.toJSON(message.status);
601
+ }
602
+ if (message.rule !== undefined) {
603
+ obj.rule = TraceRule.toJSON(message.rule);
604
+ }
605
+ return obj;
606
+ },
607
+
608
+ create<I extends Exact<DeepPartial<CreateTraceRuleResponse>, I>>(base?: I): CreateTraceRuleResponse {
609
+ return CreateTraceRuleResponse.fromPartial(base ?? ({} as any));
610
+ },
611
+ fromPartial<I extends Exact<DeepPartial<CreateTraceRuleResponse>, I>>(object: I): CreateTraceRuleResponse {
612
+ const message = createBaseCreateTraceRuleResponse();
613
+ message.status = (object.status !== undefined && object.status !== null)
614
+ ? ResponseStatus.fromPartial(object.status)
615
+ : undefined;
616
+ message.rule = (object.rule !== undefined && object.rule !== null) ? TraceRule.fromPartial(object.rule) : undefined;
617
+ return message;
618
+ },
619
+ };
620
+
621
+ function createBaseGetTraceRuleRequest(): GetTraceRuleRequest {
622
+ return { projectId: "", ruleId: "", organizationId: "" };
623
+ }
624
+
625
+ export const GetTraceRuleRequest: MessageFns<GetTraceRuleRequest> = {
626
+ encode(message: GetTraceRuleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
627
+ if (message.projectId !== "") {
628
+ writer.uint32(10).string(message.projectId);
629
+ }
630
+ if (message.ruleId !== "") {
631
+ writer.uint32(18).string(message.ruleId);
632
+ }
633
+ if (message.organizationId !== "") {
634
+ writer.uint32(26).string(message.organizationId);
635
+ }
636
+ return writer;
637
+ },
638
+
639
+ decode(input: BinaryReader | Uint8Array, length?: number): GetTraceRuleRequest {
640
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
641
+ const end = length === undefined ? reader.len : reader.pos + length;
642
+ const message = createBaseGetTraceRuleRequest();
643
+ while (reader.pos < end) {
644
+ const tag = reader.uint32();
645
+ switch (tag >>> 3) {
646
+ case 1: {
647
+ if (tag !== 10) {
648
+ break;
649
+ }
650
+
651
+ message.projectId = reader.string();
652
+ continue;
653
+ }
654
+ case 2: {
655
+ if (tag !== 18) {
656
+ break;
657
+ }
658
+
659
+ message.ruleId = reader.string();
660
+ continue;
661
+ }
662
+ case 3: {
663
+ if (tag !== 26) {
664
+ break;
665
+ }
666
+
667
+ message.organizationId = reader.string();
668
+ continue;
669
+ }
670
+ }
671
+ if ((tag & 7) === 4 || tag === 0) {
672
+ break;
673
+ }
674
+ reader.skip(tag & 7);
675
+ }
676
+ return message;
677
+ },
678
+
679
+ fromJSON(object: any): GetTraceRuleRequest {
680
+ return {
681
+ projectId: isSet(object.projectId)
682
+ ? globalThis.String(object.projectId)
683
+ : isSet(object.project_id)
684
+ ? globalThis.String(object.project_id)
685
+ : "",
686
+ ruleId: isSet(object.ruleId)
687
+ ? globalThis.String(object.ruleId)
688
+ : isSet(object.rule_id)
689
+ ? globalThis.String(object.rule_id)
690
+ : "",
691
+ organizationId: isSet(object.organizationId)
692
+ ? globalThis.String(object.organizationId)
693
+ : isSet(object.organization_id)
694
+ ? globalThis.String(object.organization_id)
695
+ : "",
696
+ };
697
+ },
698
+
699
+ toJSON(message: GetTraceRuleRequest): unknown {
700
+ const obj: any = {};
701
+ if (message.projectId !== "") {
702
+ obj.projectId = message.projectId;
703
+ }
704
+ if (message.ruleId !== "") {
705
+ obj.ruleId = message.ruleId;
706
+ }
707
+ if (message.organizationId !== "") {
708
+ obj.organizationId = message.organizationId;
709
+ }
710
+ return obj;
711
+ },
712
+
713
+ create<I extends Exact<DeepPartial<GetTraceRuleRequest>, I>>(base?: I): GetTraceRuleRequest {
714
+ return GetTraceRuleRequest.fromPartial(base ?? ({} as any));
715
+ },
716
+ fromPartial<I extends Exact<DeepPartial<GetTraceRuleRequest>, I>>(object: I): GetTraceRuleRequest {
717
+ const message = createBaseGetTraceRuleRequest();
718
+ message.projectId = object.projectId ?? "";
719
+ message.ruleId = object.ruleId ?? "";
720
+ message.organizationId = object.organizationId ?? "";
721
+ return message;
722
+ },
723
+ };
724
+
725
+ function createBaseGetTraceRuleResponse(): GetTraceRuleResponse {
726
+ return { status: undefined, rule: undefined };
727
+ }
728
+
729
+ export const GetTraceRuleResponse: MessageFns<GetTraceRuleResponse> = {
730
+ encode(message: GetTraceRuleResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
731
+ if (message.status !== undefined) {
732
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
733
+ }
734
+ if (message.rule !== undefined) {
735
+ TraceRule.encode(message.rule, writer.uint32(18).fork()).join();
736
+ }
737
+ return writer;
738
+ },
739
+
740
+ decode(input: BinaryReader | Uint8Array, length?: number): GetTraceRuleResponse {
741
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
742
+ const end = length === undefined ? reader.len : reader.pos + length;
743
+ const message = createBaseGetTraceRuleResponse();
744
+ while (reader.pos < end) {
745
+ const tag = reader.uint32();
746
+ switch (tag >>> 3) {
747
+ case 1: {
748
+ if (tag !== 10) {
749
+ break;
750
+ }
751
+
752
+ message.status = ResponseStatus.decode(reader, reader.uint32());
753
+ continue;
754
+ }
755
+ case 2: {
756
+ if (tag !== 18) {
757
+ break;
758
+ }
759
+
760
+ message.rule = TraceRule.decode(reader, reader.uint32());
761
+ continue;
762
+ }
763
+ }
764
+ if ((tag & 7) === 4 || tag === 0) {
765
+ break;
766
+ }
767
+ reader.skip(tag & 7);
768
+ }
769
+ return message;
770
+ },
771
+
772
+ fromJSON(object: any): GetTraceRuleResponse {
773
+ return {
774
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
775
+ rule: isSet(object.rule) ? TraceRule.fromJSON(object.rule) : undefined,
776
+ };
777
+ },
778
+
779
+ toJSON(message: GetTraceRuleResponse): unknown {
780
+ const obj: any = {};
781
+ if (message.status !== undefined) {
782
+ obj.status = ResponseStatus.toJSON(message.status);
783
+ }
784
+ if (message.rule !== undefined) {
785
+ obj.rule = TraceRule.toJSON(message.rule);
786
+ }
787
+ return obj;
788
+ },
789
+
790
+ create<I extends Exact<DeepPartial<GetTraceRuleResponse>, I>>(base?: I): GetTraceRuleResponse {
791
+ return GetTraceRuleResponse.fromPartial(base ?? ({} as any));
792
+ },
793
+ fromPartial<I extends Exact<DeepPartial<GetTraceRuleResponse>, I>>(object: I): GetTraceRuleResponse {
794
+ const message = createBaseGetTraceRuleResponse();
795
+ message.status = (object.status !== undefined && object.status !== null)
796
+ ? ResponseStatus.fromPartial(object.status)
797
+ : undefined;
798
+ message.rule = (object.rule !== undefined && object.rule !== null) ? TraceRule.fromPartial(object.rule) : undefined;
799
+ return message;
800
+ },
801
+ };
802
+
803
+ function createBaseListTraceRulesRequest(): ListTraceRulesRequest {
804
+ return { organizationId: "", organizationIdFilter: undefined, projectIdFilter: undefined };
805
+ }
806
+
807
+ export const ListTraceRulesRequest: MessageFns<ListTraceRulesRequest> = {
808
+ encode(message: ListTraceRulesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
809
+ if (message.organizationId !== "") {
810
+ writer.uint32(10).string(message.organizationId);
811
+ }
812
+ if (message.organizationIdFilter !== undefined) {
813
+ writer.uint32(18).string(message.organizationIdFilter);
814
+ }
815
+ if (message.projectIdFilter !== undefined) {
816
+ writer.uint32(26).string(message.projectIdFilter);
817
+ }
818
+ return writer;
819
+ },
820
+
821
+ decode(input: BinaryReader | Uint8Array, length?: number): ListTraceRulesRequest {
822
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
823
+ const end = length === undefined ? reader.len : reader.pos + length;
824
+ const message = createBaseListTraceRulesRequest();
825
+ while (reader.pos < end) {
826
+ const tag = reader.uint32();
827
+ switch (tag >>> 3) {
828
+ case 1: {
829
+ if (tag !== 10) {
830
+ break;
831
+ }
832
+
833
+ message.organizationId = reader.string();
834
+ continue;
835
+ }
836
+ case 2: {
837
+ if (tag !== 18) {
838
+ break;
839
+ }
840
+
841
+ message.organizationIdFilter = reader.string();
842
+ continue;
843
+ }
844
+ case 3: {
845
+ if (tag !== 26) {
846
+ break;
847
+ }
848
+
849
+ message.projectIdFilter = reader.string();
850
+ continue;
851
+ }
852
+ }
853
+ if ((tag & 7) === 4 || tag === 0) {
854
+ break;
855
+ }
856
+ reader.skip(tag & 7);
857
+ }
858
+ return message;
859
+ },
860
+
861
+ fromJSON(object: any): ListTraceRulesRequest {
862
+ return {
863
+ organizationId: isSet(object.organizationId)
864
+ ? globalThis.String(object.organizationId)
865
+ : isSet(object.organization_id)
866
+ ? globalThis.String(object.organization_id)
867
+ : "",
868
+ organizationIdFilter: isSet(object.organizationIdFilter)
869
+ ? globalThis.String(object.organizationIdFilter)
870
+ : isSet(object.organization_id_filter)
871
+ ? globalThis.String(object.organization_id_filter)
872
+ : undefined,
873
+ projectIdFilter: isSet(object.projectIdFilter)
874
+ ? globalThis.String(object.projectIdFilter)
875
+ : isSet(object.project_id_filter)
876
+ ? globalThis.String(object.project_id_filter)
877
+ : undefined,
878
+ };
879
+ },
880
+
881
+ toJSON(message: ListTraceRulesRequest): unknown {
882
+ const obj: any = {};
883
+ if (message.organizationId !== "") {
884
+ obj.organizationId = message.organizationId;
885
+ }
886
+ if (message.organizationIdFilter !== undefined) {
887
+ obj.organizationIdFilter = message.organizationIdFilter;
888
+ }
889
+ if (message.projectIdFilter !== undefined) {
890
+ obj.projectIdFilter = message.projectIdFilter;
891
+ }
892
+ return obj;
893
+ },
894
+
895
+ create<I extends Exact<DeepPartial<ListTraceRulesRequest>, I>>(base?: I): ListTraceRulesRequest {
896
+ return ListTraceRulesRequest.fromPartial(base ?? ({} as any));
897
+ },
898
+ fromPartial<I extends Exact<DeepPartial<ListTraceRulesRequest>, I>>(object: I): ListTraceRulesRequest {
899
+ const message = createBaseListTraceRulesRequest();
900
+ message.organizationId = object.organizationId ?? "";
901
+ message.organizationIdFilter = object.organizationIdFilter ?? undefined;
902
+ message.projectIdFilter = object.projectIdFilter ?? undefined;
903
+ return message;
904
+ },
905
+ };
906
+
907
+ function createBaseListTraceRulesResponse(): ListTraceRulesResponse {
908
+ return { status: undefined, rules: [] };
909
+ }
910
+
911
+ export const ListTraceRulesResponse: MessageFns<ListTraceRulesResponse> = {
912
+ encode(message: ListTraceRulesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
913
+ if (message.status !== undefined) {
914
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
915
+ }
916
+ for (const v of message.rules) {
917
+ TraceRule.encode(v!, writer.uint32(18).fork()).join();
918
+ }
919
+ return writer;
920
+ },
921
+
922
+ decode(input: BinaryReader | Uint8Array, length?: number): ListTraceRulesResponse {
923
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
924
+ const end = length === undefined ? reader.len : reader.pos + length;
925
+ const message = createBaseListTraceRulesResponse();
926
+ while (reader.pos < end) {
927
+ const tag = reader.uint32();
928
+ switch (tag >>> 3) {
929
+ case 1: {
930
+ if (tag !== 10) {
931
+ break;
932
+ }
933
+
934
+ message.status = ResponseStatus.decode(reader, reader.uint32());
935
+ continue;
936
+ }
937
+ case 2: {
938
+ if (tag !== 18) {
939
+ break;
940
+ }
941
+
942
+ message.rules.push(TraceRule.decode(reader, reader.uint32()));
943
+ continue;
944
+ }
945
+ }
946
+ if ((tag & 7) === 4 || tag === 0) {
947
+ break;
948
+ }
949
+ reader.skip(tag & 7);
950
+ }
951
+ return message;
952
+ },
953
+
954
+ fromJSON(object: any): ListTraceRulesResponse {
955
+ return {
956
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
957
+ rules: globalThis.Array.isArray(object?.rules) ? object.rules.map((e: any) => TraceRule.fromJSON(e)) : [],
958
+ };
959
+ },
960
+
961
+ toJSON(message: ListTraceRulesResponse): unknown {
962
+ const obj: any = {};
963
+ if (message.status !== undefined) {
964
+ obj.status = ResponseStatus.toJSON(message.status);
965
+ }
966
+ if (message.rules?.length) {
967
+ obj.rules = message.rules.map((e) => TraceRule.toJSON(e));
968
+ }
969
+ return obj;
970
+ },
971
+
972
+ create<I extends Exact<DeepPartial<ListTraceRulesResponse>, I>>(base?: I): ListTraceRulesResponse {
973
+ return ListTraceRulesResponse.fromPartial(base ?? ({} as any));
974
+ },
975
+ fromPartial<I extends Exact<DeepPartial<ListTraceRulesResponse>, I>>(object: I): ListTraceRulesResponse {
976
+ const message = createBaseListTraceRulesResponse();
977
+ message.status = (object.status !== undefined && object.status !== null)
978
+ ? ResponseStatus.fromPartial(object.status)
979
+ : undefined;
980
+ message.rules = object.rules?.map((e) => TraceRule.fromPartial(e)) || [];
981
+ return message;
982
+ },
983
+ };
984
+
985
+ function createBaseUpdateTraceRuleRequest(): UpdateTraceRuleRequest {
986
+ return { projectId: "", ruleId: "", updates: undefined, organizationId: "" };
987
+ }
988
+
989
+ export const UpdateTraceRuleRequest: MessageFns<UpdateTraceRuleRequest> = {
990
+ encode(message: UpdateTraceRuleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
991
+ if (message.projectId !== "") {
992
+ writer.uint32(10).string(message.projectId);
993
+ }
994
+ if (message.ruleId !== "") {
995
+ writer.uint32(18).string(message.ruleId);
996
+ }
997
+ if (message.updates !== undefined) {
998
+ UpdateTraceRuleRequest_TraceRuleUpdates.encode(message.updates, writer.uint32(26).fork()).join();
999
+ }
1000
+ if (message.organizationId !== "") {
1001
+ writer.uint32(34).string(message.organizationId);
1002
+ }
1003
+ return writer;
1004
+ },
1005
+
1006
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateTraceRuleRequest {
1007
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1008
+ const end = length === undefined ? reader.len : reader.pos + length;
1009
+ const message = createBaseUpdateTraceRuleRequest();
1010
+ while (reader.pos < end) {
1011
+ const tag = reader.uint32();
1012
+ switch (tag >>> 3) {
1013
+ case 1: {
1014
+ if (tag !== 10) {
1015
+ break;
1016
+ }
1017
+
1018
+ message.projectId = reader.string();
1019
+ continue;
1020
+ }
1021
+ case 2: {
1022
+ if (tag !== 18) {
1023
+ break;
1024
+ }
1025
+
1026
+ message.ruleId = reader.string();
1027
+ continue;
1028
+ }
1029
+ case 3: {
1030
+ if (tag !== 26) {
1031
+ break;
1032
+ }
1033
+
1034
+ message.updates = UpdateTraceRuleRequest_TraceRuleUpdates.decode(reader, reader.uint32());
1035
+ continue;
1036
+ }
1037
+ case 4: {
1038
+ if (tag !== 34) {
1039
+ break;
1040
+ }
1041
+
1042
+ message.organizationId = reader.string();
1043
+ continue;
1044
+ }
1045
+ }
1046
+ if ((tag & 7) === 4 || tag === 0) {
1047
+ break;
1048
+ }
1049
+ reader.skip(tag & 7);
1050
+ }
1051
+ return message;
1052
+ },
1053
+
1054
+ fromJSON(object: any): UpdateTraceRuleRequest {
1055
+ return {
1056
+ projectId: isSet(object.projectId)
1057
+ ? globalThis.String(object.projectId)
1058
+ : isSet(object.project_id)
1059
+ ? globalThis.String(object.project_id)
1060
+ : "",
1061
+ ruleId: isSet(object.ruleId)
1062
+ ? globalThis.String(object.ruleId)
1063
+ : isSet(object.rule_id)
1064
+ ? globalThis.String(object.rule_id)
1065
+ : "",
1066
+ updates: isSet(object.updates) ? UpdateTraceRuleRequest_TraceRuleUpdates.fromJSON(object.updates) : undefined,
1067
+ organizationId: isSet(object.organizationId)
1068
+ ? globalThis.String(object.organizationId)
1069
+ : isSet(object.organization_id)
1070
+ ? globalThis.String(object.organization_id)
1071
+ : "",
1072
+ };
1073
+ },
1074
+
1075
+ toJSON(message: UpdateTraceRuleRequest): unknown {
1076
+ const obj: any = {};
1077
+ if (message.projectId !== "") {
1078
+ obj.projectId = message.projectId;
1079
+ }
1080
+ if (message.ruleId !== "") {
1081
+ obj.ruleId = message.ruleId;
1082
+ }
1083
+ if (message.updates !== undefined) {
1084
+ obj.updates = UpdateTraceRuleRequest_TraceRuleUpdates.toJSON(message.updates);
1085
+ }
1086
+ if (message.organizationId !== "") {
1087
+ obj.organizationId = message.organizationId;
1088
+ }
1089
+ return obj;
1090
+ },
1091
+
1092
+ create<I extends Exact<DeepPartial<UpdateTraceRuleRequest>, I>>(base?: I): UpdateTraceRuleRequest {
1093
+ return UpdateTraceRuleRequest.fromPartial(base ?? ({} as any));
1094
+ },
1095
+ fromPartial<I extends Exact<DeepPartial<UpdateTraceRuleRequest>, I>>(object: I): UpdateTraceRuleRequest {
1096
+ const message = createBaseUpdateTraceRuleRequest();
1097
+ message.projectId = object.projectId ?? "";
1098
+ message.ruleId = object.ruleId ?? "";
1099
+ message.updates = (object.updates !== undefined && object.updates !== null)
1100
+ ? UpdateTraceRuleRequest_TraceRuleUpdates.fromPartial(object.updates)
1101
+ : undefined;
1102
+ message.organizationId = object.organizationId ?? "";
1103
+ return message;
1104
+ },
1105
+ };
1106
+
1107
+ function createBaseUpdateTraceRuleRequest_IntegrationIds(): UpdateTraceRuleRequest_IntegrationIds {
1108
+ return { ids: [] };
1109
+ }
1110
+
1111
+ export const UpdateTraceRuleRequest_IntegrationIds: MessageFns<UpdateTraceRuleRequest_IntegrationIds> = {
1112
+ encode(message: UpdateTraceRuleRequest_IntegrationIds, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1113
+ for (const v of message.ids) {
1114
+ writer.uint32(10).string(v!);
1115
+ }
1116
+ return writer;
1117
+ },
1118
+
1119
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateTraceRuleRequest_IntegrationIds {
1120
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1121
+ const end = length === undefined ? reader.len : reader.pos + length;
1122
+ const message = createBaseUpdateTraceRuleRequest_IntegrationIds();
1123
+ while (reader.pos < end) {
1124
+ const tag = reader.uint32();
1125
+ switch (tag >>> 3) {
1126
+ case 1: {
1127
+ if (tag !== 10) {
1128
+ break;
1129
+ }
1130
+
1131
+ message.ids.push(reader.string());
1132
+ continue;
1133
+ }
1134
+ }
1135
+ if ((tag & 7) === 4 || tag === 0) {
1136
+ break;
1137
+ }
1138
+ reader.skip(tag & 7);
1139
+ }
1140
+ return message;
1141
+ },
1142
+
1143
+ fromJSON(object: any): UpdateTraceRuleRequest_IntegrationIds {
1144
+ return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.String(e)) : [] };
1145
+ },
1146
+
1147
+ toJSON(message: UpdateTraceRuleRequest_IntegrationIds): unknown {
1148
+ const obj: any = {};
1149
+ if (message.ids?.length) {
1150
+ obj.ids = message.ids;
1151
+ }
1152
+ return obj;
1153
+ },
1154
+
1155
+ create<I extends Exact<DeepPartial<UpdateTraceRuleRequest_IntegrationIds>, I>>(
1156
+ base?: I,
1157
+ ): UpdateTraceRuleRequest_IntegrationIds {
1158
+ return UpdateTraceRuleRequest_IntegrationIds.fromPartial(base ?? ({} as any));
1159
+ },
1160
+ fromPartial<I extends Exact<DeepPartial<UpdateTraceRuleRequest_IntegrationIds>, I>>(
1161
+ object: I,
1162
+ ): UpdateTraceRuleRequest_IntegrationIds {
1163
+ const message = createBaseUpdateTraceRuleRequest_IntegrationIds();
1164
+ message.ids = object.ids?.map((e) => e) || [];
1165
+ return message;
1166
+ },
1167
+ };
1168
+
1169
+ function createBaseUpdateTraceRuleRequest_CelExpression(): UpdateTraceRuleRequest_CelExpression {
1170
+ return { celExpression: "" };
1171
+ }
1172
+
1173
+ export const UpdateTraceRuleRequest_CelExpression: MessageFns<UpdateTraceRuleRequest_CelExpression> = {
1174
+ encode(message: UpdateTraceRuleRequest_CelExpression, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1175
+ if (message.celExpression !== "") {
1176
+ writer.uint32(10).string(message.celExpression);
1177
+ }
1178
+ return writer;
1179
+ },
1180
+
1181
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateTraceRuleRequest_CelExpression {
1182
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1183
+ const end = length === undefined ? reader.len : reader.pos + length;
1184
+ const message = createBaseUpdateTraceRuleRequest_CelExpression();
1185
+ while (reader.pos < end) {
1186
+ const tag = reader.uint32();
1187
+ switch (tag >>> 3) {
1188
+ case 1: {
1189
+ if (tag !== 10) {
1190
+ break;
1191
+ }
1192
+
1193
+ message.celExpression = reader.string();
1194
+ continue;
1195
+ }
1196
+ }
1197
+ if ((tag & 7) === 4 || tag === 0) {
1198
+ break;
1199
+ }
1200
+ reader.skip(tag & 7);
1201
+ }
1202
+ return message;
1203
+ },
1204
+
1205
+ fromJSON(object: any): UpdateTraceRuleRequest_CelExpression {
1206
+ return {
1207
+ celExpression: isSet(object.celExpression)
1208
+ ? globalThis.String(object.celExpression)
1209
+ : isSet(object.cel_expression)
1210
+ ? globalThis.String(object.cel_expression)
1211
+ : "",
1212
+ };
1213
+ },
1214
+
1215
+ toJSON(message: UpdateTraceRuleRequest_CelExpression): unknown {
1216
+ const obj: any = {};
1217
+ if (message.celExpression !== "") {
1218
+ obj.celExpression = message.celExpression;
1219
+ }
1220
+ return obj;
1221
+ },
1222
+
1223
+ create<I extends Exact<DeepPartial<UpdateTraceRuleRequest_CelExpression>, I>>(
1224
+ base?: I,
1225
+ ): UpdateTraceRuleRequest_CelExpression {
1226
+ return UpdateTraceRuleRequest_CelExpression.fromPartial(base ?? ({} as any));
1227
+ },
1228
+ fromPartial<I extends Exact<DeepPartial<UpdateTraceRuleRequest_CelExpression>, I>>(
1229
+ object: I,
1230
+ ): UpdateTraceRuleRequest_CelExpression {
1231
+ const message = createBaseUpdateTraceRuleRequest_CelExpression();
1232
+ message.celExpression = object.celExpression ?? "";
1233
+ return message;
1234
+ },
1235
+ };
1236
+
1237
+ function createBaseUpdateTraceRuleRequest_TraceRuleUpdates(): UpdateTraceRuleRequest_TraceRuleUpdates {
1238
+ return {
1239
+ name: undefined,
1240
+ description: undefined,
1241
+ enabled: undefined,
1242
+ integrationIds: undefined,
1243
+ celExpression: undefined,
1244
+ };
1245
+ }
1246
+
1247
+ export const UpdateTraceRuleRequest_TraceRuleUpdates: MessageFns<UpdateTraceRuleRequest_TraceRuleUpdates> = {
1248
+ encode(message: UpdateTraceRuleRequest_TraceRuleUpdates, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1249
+ if (message.name !== undefined) {
1250
+ writer.uint32(10).string(message.name);
1251
+ }
1252
+ if (message.description !== undefined) {
1253
+ writer.uint32(18).string(message.description);
1254
+ }
1255
+ if (message.enabled !== undefined) {
1256
+ writer.uint32(24).int32(message.enabled);
1257
+ }
1258
+ if (message.integrationIds !== undefined) {
1259
+ UpdateTraceRuleRequest_IntegrationIds.encode(message.integrationIds, writer.uint32(34).fork()).join();
1260
+ }
1261
+ if (message.celExpression !== undefined) {
1262
+ UpdateTraceRuleRequest_CelExpression.encode(message.celExpression, writer.uint32(42).fork()).join();
1263
+ }
1264
+ return writer;
1265
+ },
1266
+
1267
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateTraceRuleRequest_TraceRuleUpdates {
1268
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1269
+ const end = length === undefined ? reader.len : reader.pos + length;
1270
+ const message = createBaseUpdateTraceRuleRequest_TraceRuleUpdates();
1271
+ while (reader.pos < end) {
1272
+ const tag = reader.uint32();
1273
+ switch (tag >>> 3) {
1274
+ case 1: {
1275
+ if (tag !== 10) {
1276
+ break;
1277
+ }
1278
+
1279
+ message.name = reader.string();
1280
+ continue;
1281
+ }
1282
+ case 2: {
1283
+ if (tag !== 18) {
1284
+ break;
1285
+ }
1286
+
1287
+ message.description = reader.string();
1288
+ continue;
1289
+ }
1290
+ case 3: {
1291
+ if (tag !== 24) {
1292
+ break;
1293
+ }
1294
+
1295
+ message.enabled = reader.int32() as any;
1296
+ continue;
1297
+ }
1298
+ case 4: {
1299
+ if (tag !== 34) {
1300
+ break;
1301
+ }
1302
+
1303
+ message.integrationIds = UpdateTraceRuleRequest_IntegrationIds.decode(reader, reader.uint32());
1304
+ continue;
1305
+ }
1306
+ case 5: {
1307
+ if (tag !== 42) {
1308
+ break;
1309
+ }
1310
+
1311
+ message.celExpression = UpdateTraceRuleRequest_CelExpression.decode(reader, reader.uint32());
1312
+ continue;
1313
+ }
1314
+ }
1315
+ if ((tag & 7) === 4 || tag === 0) {
1316
+ break;
1317
+ }
1318
+ reader.skip(tag & 7);
1319
+ }
1320
+ return message;
1321
+ },
1322
+
1323
+ fromJSON(object: any): UpdateTraceRuleRequest_TraceRuleUpdates {
1324
+ return {
1325
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
1326
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
1327
+ enabled: isSet(object.enabled) ? enabledStatusFromJSON(object.enabled) : undefined,
1328
+ integrationIds: isSet(object.integrationIds)
1329
+ ? UpdateTraceRuleRequest_IntegrationIds.fromJSON(object.integrationIds)
1330
+ : isSet(object.integration_ids)
1331
+ ? UpdateTraceRuleRequest_IntegrationIds.fromJSON(object.integration_ids)
1332
+ : undefined,
1333
+ celExpression: isSet(object.celExpression)
1334
+ ? UpdateTraceRuleRequest_CelExpression.fromJSON(object.celExpression)
1335
+ : isSet(object.cel_expression)
1336
+ ? UpdateTraceRuleRequest_CelExpression.fromJSON(object.cel_expression)
1337
+ : undefined,
1338
+ };
1339
+ },
1340
+
1341
+ toJSON(message: UpdateTraceRuleRequest_TraceRuleUpdates): unknown {
1342
+ const obj: any = {};
1343
+ if (message.name !== undefined) {
1344
+ obj.name = message.name;
1345
+ }
1346
+ if (message.description !== undefined) {
1347
+ obj.description = message.description;
1348
+ }
1349
+ if (message.enabled !== undefined) {
1350
+ obj.enabled = enabledStatusToJSON(message.enabled);
1351
+ }
1352
+ if (message.integrationIds !== undefined) {
1353
+ obj.integrationIds = UpdateTraceRuleRequest_IntegrationIds.toJSON(message.integrationIds);
1354
+ }
1355
+ if (message.celExpression !== undefined) {
1356
+ obj.celExpression = UpdateTraceRuleRequest_CelExpression.toJSON(message.celExpression);
1357
+ }
1358
+ return obj;
1359
+ },
1360
+
1361
+ create<I extends Exact<DeepPartial<UpdateTraceRuleRequest_TraceRuleUpdates>, I>>(
1362
+ base?: I,
1363
+ ): UpdateTraceRuleRequest_TraceRuleUpdates {
1364
+ return UpdateTraceRuleRequest_TraceRuleUpdates.fromPartial(base ?? ({} as any));
1365
+ },
1366
+ fromPartial<I extends Exact<DeepPartial<UpdateTraceRuleRequest_TraceRuleUpdates>, I>>(
1367
+ object: I,
1368
+ ): UpdateTraceRuleRequest_TraceRuleUpdates {
1369
+ const message = createBaseUpdateTraceRuleRequest_TraceRuleUpdates();
1370
+ message.name = object.name ?? undefined;
1371
+ message.description = object.description ?? undefined;
1372
+ message.enabled = object.enabled ?? undefined;
1373
+ message.integrationIds = (object.integrationIds !== undefined && object.integrationIds !== null)
1374
+ ? UpdateTraceRuleRequest_IntegrationIds.fromPartial(object.integrationIds)
1375
+ : undefined;
1376
+ message.celExpression = (object.celExpression !== undefined && object.celExpression !== null)
1377
+ ? UpdateTraceRuleRequest_CelExpression.fromPartial(object.celExpression)
1378
+ : undefined;
1379
+ return message;
1380
+ },
1381
+ };
1382
+
1383
+ function createBaseUpdateTraceRuleResponse(): UpdateTraceRuleResponse {
1384
+ return { status: undefined, rule: undefined };
1385
+ }
1386
+
1387
+ export const UpdateTraceRuleResponse: MessageFns<UpdateTraceRuleResponse> = {
1388
+ encode(message: UpdateTraceRuleResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1389
+ if (message.status !== undefined) {
1390
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
1391
+ }
1392
+ if (message.rule !== undefined) {
1393
+ TraceRule.encode(message.rule, writer.uint32(18).fork()).join();
1394
+ }
1395
+ return writer;
1396
+ },
1397
+
1398
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateTraceRuleResponse {
1399
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1400
+ const end = length === undefined ? reader.len : reader.pos + length;
1401
+ const message = createBaseUpdateTraceRuleResponse();
1402
+ while (reader.pos < end) {
1403
+ const tag = reader.uint32();
1404
+ switch (tag >>> 3) {
1405
+ case 1: {
1406
+ if (tag !== 10) {
1407
+ break;
1408
+ }
1409
+
1410
+ message.status = ResponseStatus.decode(reader, reader.uint32());
1411
+ continue;
1412
+ }
1413
+ case 2: {
1414
+ if (tag !== 18) {
1415
+ break;
1416
+ }
1417
+
1418
+ message.rule = TraceRule.decode(reader, reader.uint32());
1419
+ continue;
1420
+ }
1421
+ }
1422
+ if ((tag & 7) === 4 || tag === 0) {
1423
+ break;
1424
+ }
1425
+ reader.skip(tag & 7);
1426
+ }
1427
+ return message;
1428
+ },
1429
+
1430
+ fromJSON(object: any): UpdateTraceRuleResponse {
1431
+ return {
1432
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
1433
+ rule: isSet(object.rule) ? TraceRule.fromJSON(object.rule) : undefined,
1434
+ };
1435
+ },
1436
+
1437
+ toJSON(message: UpdateTraceRuleResponse): unknown {
1438
+ const obj: any = {};
1439
+ if (message.status !== undefined) {
1440
+ obj.status = ResponseStatus.toJSON(message.status);
1441
+ }
1442
+ if (message.rule !== undefined) {
1443
+ obj.rule = TraceRule.toJSON(message.rule);
1444
+ }
1445
+ return obj;
1446
+ },
1447
+
1448
+ create<I extends Exact<DeepPartial<UpdateTraceRuleResponse>, I>>(base?: I): UpdateTraceRuleResponse {
1449
+ return UpdateTraceRuleResponse.fromPartial(base ?? ({} as any));
1450
+ },
1451
+ fromPartial<I extends Exact<DeepPartial<UpdateTraceRuleResponse>, I>>(object: I): UpdateTraceRuleResponse {
1452
+ const message = createBaseUpdateTraceRuleResponse();
1453
+ message.status = (object.status !== undefined && object.status !== null)
1454
+ ? ResponseStatus.fromPartial(object.status)
1455
+ : undefined;
1456
+ message.rule = (object.rule !== undefined && object.rule !== null) ? TraceRule.fromPartial(object.rule) : undefined;
1457
+ return message;
1458
+ },
1459
+ };
1460
+
1461
+ function createBaseDeleteTraceRuleRequest(): DeleteTraceRuleRequest {
1462
+ return { projectId: "", ruleId: "", organizationId: "" };
1463
+ }
1464
+
1465
+ export const DeleteTraceRuleRequest: MessageFns<DeleteTraceRuleRequest> = {
1466
+ encode(message: DeleteTraceRuleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1467
+ if (message.projectId !== "") {
1468
+ writer.uint32(10).string(message.projectId);
1469
+ }
1470
+ if (message.ruleId !== "") {
1471
+ writer.uint32(18).string(message.ruleId);
1472
+ }
1473
+ if (message.organizationId !== "") {
1474
+ writer.uint32(26).string(message.organizationId);
1475
+ }
1476
+ return writer;
1477
+ },
1478
+
1479
+ decode(input: BinaryReader | Uint8Array, length?: number): DeleteTraceRuleRequest {
1480
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1481
+ const end = length === undefined ? reader.len : reader.pos + length;
1482
+ const message = createBaseDeleteTraceRuleRequest();
1483
+ while (reader.pos < end) {
1484
+ const tag = reader.uint32();
1485
+ switch (tag >>> 3) {
1486
+ case 1: {
1487
+ if (tag !== 10) {
1488
+ break;
1489
+ }
1490
+
1491
+ message.projectId = reader.string();
1492
+ continue;
1493
+ }
1494
+ case 2: {
1495
+ if (tag !== 18) {
1496
+ break;
1497
+ }
1498
+
1499
+ message.ruleId = reader.string();
1500
+ continue;
1501
+ }
1502
+ case 3: {
1503
+ if (tag !== 26) {
1504
+ break;
1505
+ }
1506
+
1507
+ message.organizationId = reader.string();
1508
+ continue;
1509
+ }
1510
+ }
1511
+ if ((tag & 7) === 4 || tag === 0) {
1512
+ break;
1513
+ }
1514
+ reader.skip(tag & 7);
1515
+ }
1516
+ return message;
1517
+ },
1518
+
1519
+ fromJSON(object: any): DeleteTraceRuleRequest {
1520
+ return {
1521
+ projectId: isSet(object.projectId)
1522
+ ? globalThis.String(object.projectId)
1523
+ : isSet(object.project_id)
1524
+ ? globalThis.String(object.project_id)
1525
+ : "",
1526
+ ruleId: isSet(object.ruleId)
1527
+ ? globalThis.String(object.ruleId)
1528
+ : isSet(object.rule_id)
1529
+ ? globalThis.String(object.rule_id)
1530
+ : "",
1531
+ organizationId: isSet(object.organizationId)
1532
+ ? globalThis.String(object.organizationId)
1533
+ : isSet(object.organization_id)
1534
+ ? globalThis.String(object.organization_id)
1535
+ : "",
1536
+ };
1537
+ },
1538
+
1539
+ toJSON(message: DeleteTraceRuleRequest): unknown {
1540
+ const obj: any = {};
1541
+ if (message.projectId !== "") {
1542
+ obj.projectId = message.projectId;
1543
+ }
1544
+ if (message.ruleId !== "") {
1545
+ obj.ruleId = message.ruleId;
1546
+ }
1547
+ if (message.organizationId !== "") {
1548
+ obj.organizationId = message.organizationId;
1549
+ }
1550
+ return obj;
1551
+ },
1552
+
1553
+ create<I extends Exact<DeepPartial<DeleteTraceRuleRequest>, I>>(base?: I): DeleteTraceRuleRequest {
1554
+ return DeleteTraceRuleRequest.fromPartial(base ?? ({} as any));
1555
+ },
1556
+ fromPartial<I extends Exact<DeepPartial<DeleteTraceRuleRequest>, I>>(object: I): DeleteTraceRuleRequest {
1557
+ const message = createBaseDeleteTraceRuleRequest();
1558
+ message.projectId = object.projectId ?? "";
1559
+ message.ruleId = object.ruleId ?? "";
1560
+ message.organizationId = object.organizationId ?? "";
1561
+ return message;
1562
+ },
1563
+ };
1564
+
1565
+ function createBaseDeleteTraceRuleResponse(): DeleteTraceRuleResponse {
1566
+ return { status: undefined };
1567
+ }
1568
+
1569
+ export const DeleteTraceRuleResponse: MessageFns<DeleteTraceRuleResponse> = {
1570
+ encode(message: DeleteTraceRuleResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1571
+ if (message.status !== undefined) {
1572
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
1573
+ }
1574
+ return writer;
1575
+ },
1576
+
1577
+ decode(input: BinaryReader | Uint8Array, length?: number): DeleteTraceRuleResponse {
1578
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1579
+ const end = length === undefined ? reader.len : reader.pos + length;
1580
+ const message = createBaseDeleteTraceRuleResponse();
1581
+ while (reader.pos < end) {
1582
+ const tag = reader.uint32();
1583
+ switch (tag >>> 3) {
1584
+ case 1: {
1585
+ if (tag !== 10) {
1586
+ break;
1587
+ }
1588
+
1589
+ message.status = ResponseStatus.decode(reader, reader.uint32());
1590
+ continue;
1591
+ }
1592
+ }
1593
+ if ((tag & 7) === 4 || tag === 0) {
1594
+ break;
1595
+ }
1596
+ reader.skip(tag & 7);
1597
+ }
1598
+ return message;
1599
+ },
1600
+
1601
+ fromJSON(object: any): DeleteTraceRuleResponse {
1602
+ return { status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined };
1603
+ },
1604
+
1605
+ toJSON(message: DeleteTraceRuleResponse): unknown {
1606
+ const obj: any = {};
1607
+ if (message.status !== undefined) {
1608
+ obj.status = ResponseStatus.toJSON(message.status);
1609
+ }
1610
+ return obj;
1611
+ },
1612
+
1613
+ create<I extends Exact<DeepPartial<DeleteTraceRuleResponse>, I>>(base?: I): DeleteTraceRuleResponse {
1614
+ return DeleteTraceRuleResponse.fromPartial(base ?? ({} as any));
1615
+ },
1616
+ fromPartial<I extends Exact<DeepPartial<DeleteTraceRuleResponse>, I>>(object: I): DeleteTraceRuleResponse {
1617
+ const message = createBaseDeleteTraceRuleResponse();
1618
+ message.status = (object.status !== undefined && object.status !== null)
1619
+ ? ResponseStatus.fromPartial(object.status)
1620
+ : undefined;
1621
+ return message;
1622
+ },
1623
+ };
1624
+
1625
+ function createBaseStreamTraceRuleSimulationRequest(): StreamTraceRuleSimulationRequest {
1626
+ return { projectId: "", celExpression: "", limit: 0, organizationId: "" };
1627
+ }
1628
+
1629
+ export const StreamTraceRuleSimulationRequest: MessageFns<StreamTraceRuleSimulationRequest> = {
1630
+ encode(message: StreamTraceRuleSimulationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1631
+ if (message.projectId !== "") {
1632
+ writer.uint32(10).string(message.projectId);
1633
+ }
1634
+ if (message.celExpression !== "") {
1635
+ writer.uint32(18).string(message.celExpression);
1636
+ }
1637
+ if (message.limit !== 0) {
1638
+ writer.uint32(24).int32(message.limit);
1639
+ }
1640
+ if (message.organizationId !== "") {
1641
+ writer.uint32(34).string(message.organizationId);
1642
+ }
1643
+ return writer;
1644
+ },
1645
+
1646
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamTraceRuleSimulationRequest {
1647
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1648
+ const end = length === undefined ? reader.len : reader.pos + length;
1649
+ const message = createBaseStreamTraceRuleSimulationRequest();
1650
+ while (reader.pos < end) {
1651
+ const tag = reader.uint32();
1652
+ switch (tag >>> 3) {
1653
+ case 1: {
1654
+ if (tag !== 10) {
1655
+ break;
1656
+ }
1657
+
1658
+ message.projectId = reader.string();
1659
+ continue;
1660
+ }
1661
+ case 2: {
1662
+ if (tag !== 18) {
1663
+ break;
1664
+ }
1665
+
1666
+ message.celExpression = reader.string();
1667
+ continue;
1668
+ }
1669
+ case 3: {
1670
+ if (tag !== 24) {
1671
+ break;
1672
+ }
1673
+
1674
+ message.limit = reader.int32();
1675
+ continue;
1676
+ }
1677
+ case 4: {
1678
+ if (tag !== 34) {
1679
+ break;
1680
+ }
1681
+
1682
+ message.organizationId = reader.string();
1683
+ continue;
1684
+ }
1685
+ }
1686
+ if ((tag & 7) === 4 || tag === 0) {
1687
+ break;
1688
+ }
1689
+ reader.skip(tag & 7);
1690
+ }
1691
+ return message;
1692
+ },
1693
+
1694
+ fromJSON(object: any): StreamTraceRuleSimulationRequest {
1695
+ return {
1696
+ projectId: isSet(object.projectId)
1697
+ ? globalThis.String(object.projectId)
1698
+ : isSet(object.project_id)
1699
+ ? globalThis.String(object.project_id)
1700
+ : "",
1701
+ celExpression: isSet(object.celExpression)
1702
+ ? globalThis.String(object.celExpression)
1703
+ : isSet(object.cel_expression)
1704
+ ? globalThis.String(object.cel_expression)
1705
+ : "",
1706
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
1707
+ organizationId: isSet(object.organizationId)
1708
+ ? globalThis.String(object.organizationId)
1709
+ : isSet(object.organization_id)
1710
+ ? globalThis.String(object.organization_id)
1711
+ : "",
1712
+ };
1713
+ },
1714
+
1715
+ toJSON(message: StreamTraceRuleSimulationRequest): unknown {
1716
+ const obj: any = {};
1717
+ if (message.projectId !== "") {
1718
+ obj.projectId = message.projectId;
1719
+ }
1720
+ if (message.celExpression !== "") {
1721
+ obj.celExpression = message.celExpression;
1722
+ }
1723
+ if (message.limit !== 0) {
1724
+ obj.limit = Math.round(message.limit);
1725
+ }
1726
+ if (message.organizationId !== "") {
1727
+ obj.organizationId = message.organizationId;
1728
+ }
1729
+ return obj;
1730
+ },
1731
+
1732
+ create<I extends Exact<DeepPartial<StreamTraceRuleSimulationRequest>, I>>(
1733
+ base?: I,
1734
+ ): StreamTraceRuleSimulationRequest {
1735
+ return StreamTraceRuleSimulationRequest.fromPartial(base ?? ({} as any));
1736
+ },
1737
+ fromPartial<I extends Exact<DeepPartial<StreamTraceRuleSimulationRequest>, I>>(
1738
+ object: I,
1739
+ ): StreamTraceRuleSimulationRequest {
1740
+ const message = createBaseStreamTraceRuleSimulationRequest();
1741
+ message.projectId = object.projectId ?? "";
1742
+ message.celExpression = object.celExpression ?? "";
1743
+ message.limit = object.limit ?? 0;
1744
+ message.organizationId = object.organizationId ?? "";
1745
+ return message;
1746
+ },
1747
+ };
1748
+
1749
+ function createBaseTraceRuleSimulationMatch(): TraceRuleSimulationMatch {
1750
+ return { traceId: "", traceName: "", matchReason: "", createdAt: undefined };
1751
+ }
1752
+
1753
+ export const TraceRuleSimulationMatch: MessageFns<TraceRuleSimulationMatch> = {
1754
+ encode(message: TraceRuleSimulationMatch, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1755
+ if (message.traceId !== "") {
1756
+ writer.uint32(10).string(message.traceId);
1757
+ }
1758
+ if (message.traceName !== "") {
1759
+ writer.uint32(18).string(message.traceName);
1760
+ }
1761
+ if (message.matchReason !== "") {
1762
+ writer.uint32(26).string(message.matchReason);
1763
+ }
1764
+ if (message.createdAt !== undefined) {
1765
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(34).fork()).join();
1766
+ }
1767
+ return writer;
1768
+ },
1769
+
1770
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRuleSimulationMatch {
1771
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1772
+ const end = length === undefined ? reader.len : reader.pos + length;
1773
+ const message = createBaseTraceRuleSimulationMatch();
1774
+ while (reader.pos < end) {
1775
+ const tag = reader.uint32();
1776
+ switch (tag >>> 3) {
1777
+ case 1: {
1778
+ if (tag !== 10) {
1779
+ break;
1780
+ }
1781
+
1782
+ message.traceId = reader.string();
1783
+ continue;
1784
+ }
1785
+ case 2: {
1786
+ if (tag !== 18) {
1787
+ break;
1788
+ }
1789
+
1790
+ message.traceName = reader.string();
1791
+ continue;
1792
+ }
1793
+ case 3: {
1794
+ if (tag !== 26) {
1795
+ break;
1796
+ }
1797
+
1798
+ message.matchReason = reader.string();
1799
+ continue;
1800
+ }
1801
+ case 4: {
1802
+ if (tag !== 34) {
1803
+ break;
1804
+ }
1805
+
1806
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1807
+ continue;
1808
+ }
1809
+ }
1810
+ if ((tag & 7) === 4 || tag === 0) {
1811
+ break;
1812
+ }
1813
+ reader.skip(tag & 7);
1814
+ }
1815
+ return message;
1816
+ },
1817
+
1818
+ fromJSON(object: any): TraceRuleSimulationMatch {
1819
+ return {
1820
+ traceId: isSet(object.traceId)
1821
+ ? globalThis.String(object.traceId)
1822
+ : isSet(object.trace_id)
1823
+ ? globalThis.String(object.trace_id)
1824
+ : "",
1825
+ traceName: isSet(object.traceName)
1826
+ ? globalThis.String(object.traceName)
1827
+ : isSet(object.trace_name)
1828
+ ? globalThis.String(object.trace_name)
1829
+ : "",
1830
+ matchReason: isSet(object.matchReason)
1831
+ ? globalThis.String(object.matchReason)
1832
+ : isSet(object.match_reason)
1833
+ ? globalThis.String(object.match_reason)
1834
+ : "",
1835
+ createdAt: isSet(object.createdAt)
1836
+ ? fromJsonTimestamp(object.createdAt)
1837
+ : isSet(object.created_at)
1838
+ ? fromJsonTimestamp(object.created_at)
1839
+ : undefined,
1840
+ };
1841
+ },
1842
+
1843
+ toJSON(message: TraceRuleSimulationMatch): unknown {
1844
+ const obj: any = {};
1845
+ if (message.traceId !== "") {
1846
+ obj.traceId = message.traceId;
1847
+ }
1848
+ if (message.traceName !== "") {
1849
+ obj.traceName = message.traceName;
1850
+ }
1851
+ if (message.matchReason !== "") {
1852
+ obj.matchReason = message.matchReason;
1853
+ }
1854
+ if (message.createdAt !== undefined) {
1855
+ obj.createdAt = message.createdAt.toISOString();
1856
+ }
1857
+ return obj;
1858
+ },
1859
+
1860
+ create<I extends Exact<DeepPartial<TraceRuleSimulationMatch>, I>>(base?: I): TraceRuleSimulationMatch {
1861
+ return TraceRuleSimulationMatch.fromPartial(base ?? ({} as any));
1862
+ },
1863
+ fromPartial<I extends Exact<DeepPartial<TraceRuleSimulationMatch>, I>>(object: I): TraceRuleSimulationMatch {
1864
+ const message = createBaseTraceRuleSimulationMatch();
1865
+ message.traceId = object.traceId ?? "";
1866
+ message.traceName = object.traceName ?? "";
1867
+ message.matchReason = object.matchReason ?? "";
1868
+ message.createdAt = object.createdAt ?? undefined;
1869
+ return message;
1870
+ },
1871
+ };
1872
+
1873
+ function createBaseListTraceRuleSchemasRequest(): ListTraceRuleSchemasRequest {
1874
+ return { organizationId: "" };
1875
+ }
1876
+
1877
+ export const ListTraceRuleSchemasRequest: MessageFns<ListTraceRuleSchemasRequest> = {
1878
+ encode(message: ListTraceRuleSchemasRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1879
+ if (message.organizationId !== "") {
1880
+ writer.uint32(10).string(message.organizationId);
1881
+ }
1882
+ return writer;
1883
+ },
1884
+
1885
+ decode(input: BinaryReader | Uint8Array, length?: number): ListTraceRuleSchemasRequest {
1886
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1887
+ const end = length === undefined ? reader.len : reader.pos + length;
1888
+ const message = createBaseListTraceRuleSchemasRequest();
1889
+ while (reader.pos < end) {
1890
+ const tag = reader.uint32();
1891
+ switch (tag >>> 3) {
1892
+ case 1: {
1893
+ if (tag !== 10) {
1894
+ break;
1895
+ }
1896
+
1897
+ message.organizationId = reader.string();
1898
+ continue;
1899
+ }
1900
+ }
1901
+ if ((tag & 7) === 4 || tag === 0) {
1902
+ break;
1903
+ }
1904
+ reader.skip(tag & 7);
1905
+ }
1906
+ return message;
1907
+ },
1908
+
1909
+ fromJSON(object: any): ListTraceRuleSchemasRequest {
1910
+ return {
1911
+ organizationId: isSet(object.organizationId)
1912
+ ? globalThis.String(object.organizationId)
1913
+ : isSet(object.organization_id)
1914
+ ? globalThis.String(object.organization_id)
1915
+ : "",
1916
+ };
1917
+ },
1918
+
1919
+ toJSON(message: ListTraceRuleSchemasRequest): unknown {
1920
+ const obj: any = {};
1921
+ if (message.organizationId !== "") {
1922
+ obj.organizationId = message.organizationId;
1923
+ }
1924
+ return obj;
1925
+ },
1926
+
1927
+ create<I extends Exact<DeepPartial<ListTraceRuleSchemasRequest>, I>>(base?: I): ListTraceRuleSchemasRequest {
1928
+ return ListTraceRuleSchemasRequest.fromPartial(base ?? ({} as any));
1929
+ },
1930
+ fromPartial<I extends Exact<DeepPartial<ListTraceRuleSchemasRequest>, I>>(object: I): ListTraceRuleSchemasRequest {
1931
+ const message = createBaseListTraceRuleSchemasRequest();
1932
+ message.organizationId = object.organizationId ?? "";
1933
+ return message;
1934
+ },
1935
+ };
1936
+
1937
+ function createBaseListTraceRuleSchemasResponse(): ListTraceRuleSchemasResponse {
1938
+ return { status: undefined, schemas: [] };
1939
+ }
1940
+
1941
+ export const ListTraceRuleSchemasResponse: MessageFns<ListTraceRuleSchemasResponse> = {
1942
+ encode(message: ListTraceRuleSchemasResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1943
+ if (message.status !== undefined) {
1944
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
1945
+ }
1946
+ for (const v of message.schemas) {
1947
+ TraceRuleSchema.encode(v!, writer.uint32(18).fork()).join();
1948
+ }
1949
+ return writer;
1950
+ },
1951
+
1952
+ decode(input: BinaryReader | Uint8Array, length?: number): ListTraceRuleSchemasResponse {
1953
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1954
+ const end = length === undefined ? reader.len : reader.pos + length;
1955
+ const message = createBaseListTraceRuleSchemasResponse();
1956
+ while (reader.pos < end) {
1957
+ const tag = reader.uint32();
1958
+ switch (tag >>> 3) {
1959
+ case 1: {
1960
+ if (tag !== 10) {
1961
+ break;
1962
+ }
1963
+
1964
+ message.status = ResponseStatus.decode(reader, reader.uint32());
1965
+ continue;
1966
+ }
1967
+ case 2: {
1968
+ if (tag !== 18) {
1969
+ break;
1970
+ }
1971
+
1972
+ message.schemas.push(TraceRuleSchema.decode(reader, reader.uint32()));
1973
+ continue;
1974
+ }
1975
+ }
1976
+ if ((tag & 7) === 4 || tag === 0) {
1977
+ break;
1978
+ }
1979
+ reader.skip(tag & 7);
1980
+ }
1981
+ return message;
1982
+ },
1983
+
1984
+ fromJSON(object: any): ListTraceRuleSchemasResponse {
1985
+ return {
1986
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
1987
+ schemas: globalThis.Array.isArray(object?.schemas)
1988
+ ? object.schemas.map((e: any) => TraceRuleSchema.fromJSON(e))
1989
+ : [],
1990
+ };
1991
+ },
1992
+
1993
+ toJSON(message: ListTraceRuleSchemasResponse): unknown {
1994
+ const obj: any = {};
1995
+ if (message.status !== undefined) {
1996
+ obj.status = ResponseStatus.toJSON(message.status);
1997
+ }
1998
+ if (message.schemas?.length) {
1999
+ obj.schemas = message.schemas.map((e) => TraceRuleSchema.toJSON(e));
2000
+ }
2001
+ return obj;
2002
+ },
2003
+
2004
+ create<I extends Exact<DeepPartial<ListTraceRuleSchemasResponse>, I>>(base?: I): ListTraceRuleSchemasResponse {
2005
+ return ListTraceRuleSchemasResponse.fromPartial(base ?? ({} as any));
2006
+ },
2007
+ fromPartial<I extends Exact<DeepPartial<ListTraceRuleSchemasResponse>, I>>(object: I): ListTraceRuleSchemasResponse {
2008
+ const message = createBaseListTraceRuleSchemasResponse();
2009
+ message.status = (object.status !== undefined && object.status !== null)
2010
+ ? ResponseStatus.fromPartial(object.status)
2011
+ : undefined;
2012
+ message.schemas = object.schemas?.map((e) => TraceRuleSchema.fromPartial(e)) || [];
2013
+ return message;
2014
+ },
2015
+ };
2016
+
2017
+ function createBaseTraceRuleSchema(): TraceRuleSchema {
2018
+ return { id: "", label: "", rootVariable: "", jsonSchema: "" };
2019
+ }
2020
+
2021
+ export const TraceRuleSchema: MessageFns<TraceRuleSchema> = {
2022
+ encode(message: TraceRuleSchema, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2023
+ if (message.id !== "") {
2024
+ writer.uint32(10).string(message.id);
2025
+ }
2026
+ if (message.label !== "") {
2027
+ writer.uint32(18).string(message.label);
2028
+ }
2029
+ if (message.rootVariable !== "") {
2030
+ writer.uint32(26).string(message.rootVariable);
2031
+ }
2032
+ if (message.jsonSchema !== "") {
2033
+ writer.uint32(34).string(message.jsonSchema);
2034
+ }
2035
+ return writer;
2036
+ },
2037
+
2038
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRuleSchema {
2039
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2040
+ const end = length === undefined ? reader.len : reader.pos + length;
2041
+ const message = createBaseTraceRuleSchema();
2042
+ while (reader.pos < end) {
2043
+ const tag = reader.uint32();
2044
+ switch (tag >>> 3) {
2045
+ case 1: {
2046
+ if (tag !== 10) {
2047
+ break;
2048
+ }
2049
+
2050
+ message.id = reader.string();
2051
+ continue;
2052
+ }
2053
+ case 2: {
2054
+ if (tag !== 18) {
2055
+ break;
2056
+ }
2057
+
2058
+ message.label = reader.string();
2059
+ continue;
2060
+ }
2061
+ case 3: {
2062
+ if (tag !== 26) {
2063
+ break;
2064
+ }
2065
+
2066
+ message.rootVariable = reader.string();
2067
+ continue;
2068
+ }
2069
+ case 4: {
2070
+ if (tag !== 34) {
2071
+ break;
2072
+ }
2073
+
2074
+ message.jsonSchema = reader.string();
2075
+ continue;
2076
+ }
2077
+ }
2078
+ if ((tag & 7) === 4 || tag === 0) {
2079
+ break;
2080
+ }
2081
+ reader.skip(tag & 7);
2082
+ }
2083
+ return message;
2084
+ },
2085
+
2086
+ fromJSON(object: any): TraceRuleSchema {
2087
+ return {
2088
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2089
+ label: isSet(object.label) ? globalThis.String(object.label) : "",
2090
+ rootVariable: isSet(object.rootVariable)
2091
+ ? globalThis.String(object.rootVariable)
2092
+ : isSet(object.root_variable)
2093
+ ? globalThis.String(object.root_variable)
2094
+ : "",
2095
+ jsonSchema: isSet(object.jsonSchema)
2096
+ ? globalThis.String(object.jsonSchema)
2097
+ : isSet(object.json_schema)
2098
+ ? globalThis.String(object.json_schema)
2099
+ : "",
2100
+ };
2101
+ },
2102
+
2103
+ toJSON(message: TraceRuleSchema): unknown {
2104
+ const obj: any = {};
2105
+ if (message.id !== "") {
2106
+ obj.id = message.id;
2107
+ }
2108
+ if (message.label !== "") {
2109
+ obj.label = message.label;
2110
+ }
2111
+ if (message.rootVariable !== "") {
2112
+ obj.rootVariable = message.rootVariable;
2113
+ }
2114
+ if (message.jsonSchema !== "") {
2115
+ obj.jsonSchema = message.jsonSchema;
2116
+ }
2117
+ return obj;
2118
+ },
2119
+
2120
+ create<I extends Exact<DeepPartial<TraceRuleSchema>, I>>(base?: I): TraceRuleSchema {
2121
+ return TraceRuleSchema.fromPartial(base ?? ({} as any));
2122
+ },
2123
+ fromPartial<I extends Exact<DeepPartial<TraceRuleSchema>, I>>(object: I): TraceRuleSchema {
2124
+ const message = createBaseTraceRuleSchema();
2125
+ message.id = object.id ?? "";
2126
+ message.label = object.label ?? "";
2127
+ message.rootVariable = object.rootVariable ?? "";
2128
+ message.jsonSchema = object.jsonSchema ?? "";
2129
+ return message;
2130
+ },
2131
+ };
2132
+
2133
+ function createBaseStreamTraceRuleMatchesRequest(): StreamTraceRuleMatchesRequest {
2134
+ return { projectId: "", organizationId: "", limit: 0 };
2135
+ }
2136
+
2137
+ export const StreamTraceRuleMatchesRequest: MessageFns<StreamTraceRuleMatchesRequest> = {
2138
+ encode(message: StreamTraceRuleMatchesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2139
+ if (message.projectId !== "") {
2140
+ writer.uint32(10).string(message.projectId);
2141
+ }
2142
+ if (message.organizationId !== "") {
2143
+ writer.uint32(18).string(message.organizationId);
2144
+ }
2145
+ if (message.limit !== 0) {
2146
+ writer.uint32(24).int32(message.limit);
2147
+ }
2148
+ return writer;
2149
+ },
2150
+
2151
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamTraceRuleMatchesRequest {
2152
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2153
+ const end = length === undefined ? reader.len : reader.pos + length;
2154
+ const message = createBaseStreamTraceRuleMatchesRequest();
2155
+ while (reader.pos < end) {
2156
+ const tag = reader.uint32();
2157
+ switch (tag >>> 3) {
2158
+ case 1: {
2159
+ if (tag !== 10) {
2160
+ break;
2161
+ }
2162
+
2163
+ message.projectId = reader.string();
2164
+ continue;
2165
+ }
2166
+ case 2: {
2167
+ if (tag !== 18) {
2168
+ break;
2169
+ }
2170
+
2171
+ message.organizationId = reader.string();
2172
+ continue;
2173
+ }
2174
+ case 3: {
2175
+ if (tag !== 24) {
2176
+ break;
2177
+ }
2178
+
2179
+ message.limit = reader.int32();
2180
+ continue;
2181
+ }
2182
+ }
2183
+ if ((tag & 7) === 4 || tag === 0) {
2184
+ break;
2185
+ }
2186
+ reader.skip(tag & 7);
2187
+ }
2188
+ return message;
2189
+ },
2190
+
2191
+ fromJSON(object: any): StreamTraceRuleMatchesRequest {
2192
+ return {
2193
+ projectId: isSet(object.projectId)
2194
+ ? globalThis.String(object.projectId)
2195
+ : isSet(object.project_id)
2196
+ ? globalThis.String(object.project_id)
2197
+ : "",
2198
+ organizationId: isSet(object.organizationId)
2199
+ ? globalThis.String(object.organizationId)
2200
+ : isSet(object.organization_id)
2201
+ ? globalThis.String(object.organization_id)
2202
+ : "",
2203
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
2204
+ };
2205
+ },
2206
+
2207
+ toJSON(message: StreamTraceRuleMatchesRequest): unknown {
2208
+ const obj: any = {};
2209
+ if (message.projectId !== "") {
2210
+ obj.projectId = message.projectId;
2211
+ }
2212
+ if (message.organizationId !== "") {
2213
+ obj.organizationId = message.organizationId;
2214
+ }
2215
+ if (message.limit !== 0) {
2216
+ obj.limit = Math.round(message.limit);
2217
+ }
2218
+ return obj;
2219
+ },
2220
+
2221
+ create<I extends Exact<DeepPartial<StreamTraceRuleMatchesRequest>, I>>(base?: I): StreamTraceRuleMatchesRequest {
2222
+ return StreamTraceRuleMatchesRequest.fromPartial(base ?? ({} as any));
2223
+ },
2224
+ fromPartial<I extends Exact<DeepPartial<StreamTraceRuleMatchesRequest>, I>>(
2225
+ object: I,
2226
+ ): StreamTraceRuleMatchesRequest {
2227
+ const message = createBaseStreamTraceRuleMatchesRequest();
2228
+ message.projectId = object.projectId ?? "";
2229
+ message.organizationId = object.organizationId ?? "";
2230
+ message.limit = object.limit ?? 0;
2231
+ return message;
2232
+ },
2233
+ };
2234
+
2235
+ function createBaseTraceRuleMatchEnvelope(): TraceRuleMatchEnvelope {
2236
+ return { snapshot: undefined, update: undefined };
2237
+ }
2238
+
2239
+ export const TraceRuleMatchEnvelope: MessageFns<TraceRuleMatchEnvelope> = {
2240
+ encode(message: TraceRuleMatchEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2241
+ if (message.snapshot !== undefined) {
2242
+ TraceRuleMatchSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
2243
+ }
2244
+ if (message.update !== undefined) {
2245
+ TraceRuleMatchEvent.encode(message.update, writer.uint32(18).fork()).join();
2246
+ }
2247
+ return writer;
2248
+ },
2249
+
2250
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRuleMatchEnvelope {
2251
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2252
+ const end = length === undefined ? reader.len : reader.pos + length;
2253
+ const message = createBaseTraceRuleMatchEnvelope();
2254
+ while (reader.pos < end) {
2255
+ const tag = reader.uint32();
2256
+ switch (tag >>> 3) {
2257
+ case 1: {
2258
+ if (tag !== 10) {
2259
+ break;
2260
+ }
2261
+
2262
+ message.snapshot = TraceRuleMatchSnapshot.decode(reader, reader.uint32());
2263
+ continue;
2264
+ }
2265
+ case 2: {
2266
+ if (tag !== 18) {
2267
+ break;
2268
+ }
2269
+
2270
+ message.update = TraceRuleMatchEvent.decode(reader, reader.uint32());
2271
+ continue;
2272
+ }
2273
+ }
2274
+ if ((tag & 7) === 4 || tag === 0) {
2275
+ break;
2276
+ }
2277
+ reader.skip(tag & 7);
2278
+ }
2279
+ return message;
2280
+ },
2281
+
2282
+ fromJSON(object: any): TraceRuleMatchEnvelope {
2283
+ return {
2284
+ snapshot: isSet(object.snapshot) ? TraceRuleMatchSnapshot.fromJSON(object.snapshot) : undefined,
2285
+ update: isSet(object.update) ? TraceRuleMatchEvent.fromJSON(object.update) : undefined,
2286
+ };
2287
+ },
2288
+
2289
+ toJSON(message: TraceRuleMatchEnvelope): unknown {
2290
+ const obj: any = {};
2291
+ if (message.snapshot !== undefined) {
2292
+ obj.snapshot = TraceRuleMatchSnapshot.toJSON(message.snapshot);
2293
+ }
2294
+ if (message.update !== undefined) {
2295
+ obj.update = TraceRuleMatchEvent.toJSON(message.update);
2296
+ }
2297
+ return obj;
2298
+ },
2299
+
2300
+ create<I extends Exact<DeepPartial<TraceRuleMatchEnvelope>, I>>(base?: I): TraceRuleMatchEnvelope {
2301
+ return TraceRuleMatchEnvelope.fromPartial(base ?? ({} as any));
2302
+ },
2303
+ fromPartial<I extends Exact<DeepPartial<TraceRuleMatchEnvelope>, I>>(object: I): TraceRuleMatchEnvelope {
2304
+ const message = createBaseTraceRuleMatchEnvelope();
2305
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
2306
+ ? TraceRuleMatchSnapshot.fromPartial(object.snapshot)
2307
+ : undefined;
2308
+ message.update = (object.update !== undefined && object.update !== null)
2309
+ ? TraceRuleMatchEvent.fromPartial(object.update)
2310
+ : undefined;
2311
+ return message;
2312
+ },
2313
+ };
2314
+
2315
+ function createBaseTraceRuleMatchSnapshot(): TraceRuleMatchSnapshot {
2316
+ return { matches: [] };
2317
+ }
2318
+
2319
+ export const TraceRuleMatchSnapshot: MessageFns<TraceRuleMatchSnapshot> = {
2320
+ encode(message: TraceRuleMatchSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2321
+ for (const v of message.matches) {
2322
+ TraceRuleMatchEvent.encode(v!, writer.uint32(10).fork()).join();
2323
+ }
2324
+ return writer;
2325
+ },
2326
+
2327
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRuleMatchSnapshot {
2328
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2329
+ const end = length === undefined ? reader.len : reader.pos + length;
2330
+ const message = createBaseTraceRuleMatchSnapshot();
2331
+ while (reader.pos < end) {
2332
+ const tag = reader.uint32();
2333
+ switch (tag >>> 3) {
2334
+ case 1: {
2335
+ if (tag !== 10) {
2336
+ break;
2337
+ }
2338
+
2339
+ message.matches.push(TraceRuleMatchEvent.decode(reader, reader.uint32()));
2340
+ continue;
2341
+ }
2342
+ }
2343
+ if ((tag & 7) === 4 || tag === 0) {
2344
+ break;
2345
+ }
2346
+ reader.skip(tag & 7);
2347
+ }
2348
+ return message;
2349
+ },
2350
+
2351
+ fromJSON(object: any): TraceRuleMatchSnapshot {
2352
+ return {
2353
+ matches: globalThis.Array.isArray(object?.matches)
2354
+ ? object.matches.map((e: any) => TraceRuleMatchEvent.fromJSON(e))
2355
+ : [],
2356
+ };
2357
+ },
2358
+
2359
+ toJSON(message: TraceRuleMatchSnapshot): unknown {
2360
+ const obj: any = {};
2361
+ if (message.matches?.length) {
2362
+ obj.matches = message.matches.map((e) => TraceRuleMatchEvent.toJSON(e));
2363
+ }
2364
+ return obj;
2365
+ },
2366
+
2367
+ create<I extends Exact<DeepPartial<TraceRuleMatchSnapshot>, I>>(base?: I): TraceRuleMatchSnapshot {
2368
+ return TraceRuleMatchSnapshot.fromPartial(base ?? ({} as any));
2369
+ },
2370
+ fromPartial<I extends Exact<DeepPartial<TraceRuleMatchSnapshot>, I>>(object: I): TraceRuleMatchSnapshot {
2371
+ const message = createBaseTraceRuleMatchSnapshot();
2372
+ message.matches = object.matches?.map((e) => TraceRuleMatchEvent.fromPartial(e)) || [];
2373
+ return message;
2374
+ },
2375
+ };
2376
+
2377
+ function createBaseTraceRuleMatchEvent(): TraceRuleMatchEvent {
2378
+ return {
2379
+ matchId: "",
2380
+ projectId: "",
2381
+ ruleId: "",
2382
+ ruleName: "",
2383
+ integrationIds: [],
2384
+ matchReason: "",
2385
+ createdAt: undefined,
2386
+ entityContexts: [],
2387
+ };
2388
+ }
2389
+
2390
+ export const TraceRuleMatchEvent: MessageFns<TraceRuleMatchEvent> = {
2391
+ encode(message: TraceRuleMatchEvent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2392
+ if (message.matchId !== "") {
2393
+ writer.uint32(10).string(message.matchId);
2394
+ }
2395
+ if (message.projectId !== "") {
2396
+ writer.uint32(18).string(message.projectId);
2397
+ }
2398
+ if (message.ruleId !== "") {
2399
+ writer.uint32(26).string(message.ruleId);
2400
+ }
2401
+ if (message.ruleName !== "") {
2402
+ writer.uint32(34).string(message.ruleName);
2403
+ }
2404
+ for (const v of message.integrationIds) {
2405
+ writer.uint32(42).string(v!);
2406
+ }
2407
+ if (message.matchReason !== "") {
2408
+ writer.uint32(50).string(message.matchReason);
2409
+ }
2410
+ if (message.createdAt !== undefined) {
2411
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
2412
+ }
2413
+ for (const v of message.entityContexts) {
2414
+ TraceRuleMatchEvent_EntityContext.encode(v!, writer.uint32(66).fork()).join();
2415
+ }
2416
+ return writer;
2417
+ },
2418
+
2419
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRuleMatchEvent {
2420
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2421
+ const end = length === undefined ? reader.len : reader.pos + length;
2422
+ const message = createBaseTraceRuleMatchEvent();
2423
+ while (reader.pos < end) {
2424
+ const tag = reader.uint32();
2425
+ switch (tag >>> 3) {
2426
+ case 1: {
2427
+ if (tag !== 10) {
2428
+ break;
2429
+ }
2430
+
2431
+ message.matchId = reader.string();
2432
+ continue;
2433
+ }
2434
+ case 2: {
2435
+ if (tag !== 18) {
2436
+ break;
2437
+ }
2438
+
2439
+ message.projectId = reader.string();
2440
+ continue;
2441
+ }
2442
+ case 3: {
2443
+ if (tag !== 26) {
2444
+ break;
2445
+ }
2446
+
2447
+ message.ruleId = reader.string();
2448
+ continue;
2449
+ }
2450
+ case 4: {
2451
+ if (tag !== 34) {
2452
+ break;
2453
+ }
2454
+
2455
+ message.ruleName = reader.string();
2456
+ continue;
2457
+ }
2458
+ case 5: {
2459
+ if (tag !== 42) {
2460
+ break;
2461
+ }
2462
+
2463
+ message.integrationIds.push(reader.string());
2464
+ continue;
2465
+ }
2466
+ case 6: {
2467
+ if (tag !== 50) {
2468
+ break;
2469
+ }
2470
+
2471
+ message.matchReason = reader.string();
2472
+ continue;
2473
+ }
2474
+ case 7: {
2475
+ if (tag !== 58) {
2476
+ break;
2477
+ }
2478
+
2479
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2480
+ continue;
2481
+ }
2482
+ case 8: {
2483
+ if (tag !== 66) {
2484
+ break;
2485
+ }
2486
+
2487
+ message.entityContexts.push(TraceRuleMatchEvent_EntityContext.decode(reader, reader.uint32()));
2488
+ continue;
2489
+ }
2490
+ }
2491
+ if ((tag & 7) === 4 || tag === 0) {
2492
+ break;
2493
+ }
2494
+ reader.skip(tag & 7);
2495
+ }
2496
+ return message;
2497
+ },
2498
+
2499
+ fromJSON(object: any): TraceRuleMatchEvent {
2500
+ return {
2501
+ matchId: isSet(object.matchId)
2502
+ ? globalThis.String(object.matchId)
2503
+ : isSet(object.match_id)
2504
+ ? globalThis.String(object.match_id)
2505
+ : "",
2506
+ projectId: isSet(object.projectId)
2507
+ ? globalThis.String(object.projectId)
2508
+ : isSet(object.project_id)
2509
+ ? globalThis.String(object.project_id)
2510
+ : "",
2511
+ ruleId: isSet(object.ruleId)
2512
+ ? globalThis.String(object.ruleId)
2513
+ : isSet(object.rule_id)
2514
+ ? globalThis.String(object.rule_id)
2515
+ : "",
2516
+ ruleName: isSet(object.ruleName)
2517
+ ? globalThis.String(object.ruleName)
2518
+ : isSet(object.rule_name)
2519
+ ? globalThis.String(object.rule_name)
2520
+ : "",
2521
+ integrationIds: globalThis.Array.isArray(object?.integrationIds)
2522
+ ? object.integrationIds.map((e: any) => globalThis.String(e))
2523
+ : globalThis.Array.isArray(object?.integration_ids)
2524
+ ? object.integration_ids.map((e: any) => globalThis.String(e))
2525
+ : [],
2526
+ matchReason: isSet(object.matchReason)
2527
+ ? globalThis.String(object.matchReason)
2528
+ : isSet(object.match_reason)
2529
+ ? globalThis.String(object.match_reason)
2530
+ : "",
2531
+ createdAt: isSet(object.createdAt)
2532
+ ? fromJsonTimestamp(object.createdAt)
2533
+ : isSet(object.created_at)
2534
+ ? fromJsonTimestamp(object.created_at)
2535
+ : undefined,
2536
+ entityContexts: globalThis.Array.isArray(object?.entityContexts)
2537
+ ? object.entityContexts.map((e: any) => TraceRuleMatchEvent_EntityContext.fromJSON(e))
2538
+ : globalThis.Array.isArray(object?.entity_contexts)
2539
+ ? object.entity_contexts.map((e: any) => TraceRuleMatchEvent_EntityContext.fromJSON(e))
2540
+ : [],
2541
+ };
2542
+ },
2543
+
2544
+ toJSON(message: TraceRuleMatchEvent): unknown {
2545
+ const obj: any = {};
2546
+ if (message.matchId !== "") {
2547
+ obj.matchId = message.matchId;
2548
+ }
2549
+ if (message.projectId !== "") {
2550
+ obj.projectId = message.projectId;
2551
+ }
2552
+ if (message.ruleId !== "") {
2553
+ obj.ruleId = message.ruleId;
2554
+ }
2555
+ if (message.ruleName !== "") {
2556
+ obj.ruleName = message.ruleName;
2557
+ }
2558
+ if (message.integrationIds?.length) {
2559
+ obj.integrationIds = message.integrationIds;
2560
+ }
2561
+ if (message.matchReason !== "") {
2562
+ obj.matchReason = message.matchReason;
2563
+ }
2564
+ if (message.createdAt !== undefined) {
2565
+ obj.createdAt = message.createdAt.toISOString();
2566
+ }
2567
+ if (message.entityContexts?.length) {
2568
+ obj.entityContexts = message.entityContexts.map((e) => TraceRuleMatchEvent_EntityContext.toJSON(e));
2569
+ }
2570
+ return obj;
2571
+ },
2572
+
2573
+ create<I extends Exact<DeepPartial<TraceRuleMatchEvent>, I>>(base?: I): TraceRuleMatchEvent {
2574
+ return TraceRuleMatchEvent.fromPartial(base ?? ({} as any));
2575
+ },
2576
+ fromPartial<I extends Exact<DeepPartial<TraceRuleMatchEvent>, I>>(object: I): TraceRuleMatchEvent {
2577
+ const message = createBaseTraceRuleMatchEvent();
2578
+ message.matchId = object.matchId ?? "";
2579
+ message.projectId = object.projectId ?? "";
2580
+ message.ruleId = object.ruleId ?? "";
2581
+ message.ruleName = object.ruleName ?? "";
2582
+ message.integrationIds = object.integrationIds?.map((e) => e) || [];
2583
+ message.matchReason = object.matchReason ?? "";
2584
+ message.createdAt = object.createdAt ?? undefined;
2585
+ message.entityContexts = object.entityContexts?.map((e) => TraceRuleMatchEvent_EntityContext.fromPartial(e)) || [];
2586
+ return message;
2587
+ },
2588
+ };
2589
+
2590
+ function createBaseTraceRuleMatchEvent_EntityContext(): TraceRuleMatchEvent_EntityContext {
2591
+ return { traceContext: undefined };
2592
+ }
2593
+
2594
+ export const TraceRuleMatchEvent_EntityContext: MessageFns<TraceRuleMatchEvent_EntityContext> = {
2595
+ encode(message: TraceRuleMatchEvent_EntityContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2596
+ if (message.traceContext !== undefined) {
2597
+ TraceRuleMatchEvent_EntityContext_TraceContext.encode(message.traceContext, writer.uint32(10).fork()).join();
2598
+ }
2599
+ return writer;
2600
+ },
2601
+
2602
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRuleMatchEvent_EntityContext {
2603
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2604
+ const end = length === undefined ? reader.len : reader.pos + length;
2605
+ const message = createBaseTraceRuleMatchEvent_EntityContext();
2606
+ while (reader.pos < end) {
2607
+ const tag = reader.uint32();
2608
+ switch (tag >>> 3) {
2609
+ case 1: {
2610
+ if (tag !== 10) {
2611
+ break;
2612
+ }
2613
+
2614
+ message.traceContext = TraceRuleMatchEvent_EntityContext_TraceContext.decode(reader, reader.uint32());
2615
+ continue;
2616
+ }
2617
+ }
2618
+ if ((tag & 7) === 4 || tag === 0) {
2619
+ break;
2620
+ }
2621
+ reader.skip(tag & 7);
2622
+ }
2623
+ return message;
2624
+ },
2625
+
2626
+ fromJSON(object: any): TraceRuleMatchEvent_EntityContext {
2627
+ return {
2628
+ traceContext: isSet(object.traceContext)
2629
+ ? TraceRuleMatchEvent_EntityContext_TraceContext.fromJSON(object.traceContext)
2630
+ : isSet(object.trace_context)
2631
+ ? TraceRuleMatchEvent_EntityContext_TraceContext.fromJSON(object.trace_context)
2632
+ : undefined,
2633
+ };
2634
+ },
2635
+
2636
+ toJSON(message: TraceRuleMatchEvent_EntityContext): unknown {
2637
+ const obj: any = {};
2638
+ if (message.traceContext !== undefined) {
2639
+ obj.traceContext = TraceRuleMatchEvent_EntityContext_TraceContext.toJSON(message.traceContext);
2640
+ }
2641
+ return obj;
2642
+ },
2643
+
2644
+ create<I extends Exact<DeepPartial<TraceRuleMatchEvent_EntityContext>, I>>(
2645
+ base?: I,
2646
+ ): TraceRuleMatchEvent_EntityContext {
2647
+ return TraceRuleMatchEvent_EntityContext.fromPartial(base ?? ({} as any));
2648
+ },
2649
+ fromPartial<I extends Exact<DeepPartial<TraceRuleMatchEvent_EntityContext>, I>>(
2650
+ object: I,
2651
+ ): TraceRuleMatchEvent_EntityContext {
2652
+ const message = createBaseTraceRuleMatchEvent_EntityContext();
2653
+ message.traceContext = (object.traceContext !== undefined && object.traceContext !== null)
2654
+ ? TraceRuleMatchEvent_EntityContext_TraceContext.fromPartial(object.traceContext)
2655
+ : undefined;
2656
+ return message;
2657
+ },
2658
+ };
2659
+
2660
+ function createBaseTraceRuleMatchEvent_EntityContext_TraceContext(): TraceRuleMatchEvent_EntityContext_TraceContext {
2661
+ return { traceId: "" };
2662
+ }
2663
+
2664
+ export const TraceRuleMatchEvent_EntityContext_TraceContext: MessageFns<
2665
+ TraceRuleMatchEvent_EntityContext_TraceContext
2666
+ > = {
2667
+ encode(
2668
+ message: TraceRuleMatchEvent_EntityContext_TraceContext,
2669
+ writer: BinaryWriter = new BinaryWriter(),
2670
+ ): BinaryWriter {
2671
+ if (message.traceId !== "") {
2672
+ writer.uint32(10).string(message.traceId);
2673
+ }
2674
+ return writer;
2675
+ },
2676
+
2677
+ decode(input: BinaryReader | Uint8Array, length?: number): TraceRuleMatchEvent_EntityContext_TraceContext {
2678
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2679
+ const end = length === undefined ? reader.len : reader.pos + length;
2680
+ const message = createBaseTraceRuleMatchEvent_EntityContext_TraceContext();
2681
+ while (reader.pos < end) {
2682
+ const tag = reader.uint32();
2683
+ switch (tag >>> 3) {
2684
+ case 1: {
2685
+ if (tag !== 10) {
2686
+ break;
2687
+ }
2688
+
2689
+ message.traceId = reader.string();
2690
+ continue;
2691
+ }
2692
+ }
2693
+ if ((tag & 7) === 4 || tag === 0) {
2694
+ break;
2695
+ }
2696
+ reader.skip(tag & 7);
2697
+ }
2698
+ return message;
2699
+ },
2700
+
2701
+ fromJSON(object: any): TraceRuleMatchEvent_EntityContext_TraceContext {
2702
+ return {
2703
+ traceId: isSet(object.traceId)
2704
+ ? globalThis.String(object.traceId)
2705
+ : isSet(object.trace_id)
2706
+ ? globalThis.String(object.trace_id)
2707
+ : "",
2708
+ };
2709
+ },
2710
+
2711
+ toJSON(message: TraceRuleMatchEvent_EntityContext_TraceContext): unknown {
2712
+ const obj: any = {};
2713
+ if (message.traceId !== "") {
2714
+ obj.traceId = message.traceId;
2715
+ }
2716
+ return obj;
2717
+ },
2718
+
2719
+ create<I extends Exact<DeepPartial<TraceRuleMatchEvent_EntityContext_TraceContext>, I>>(
2720
+ base?: I,
2721
+ ): TraceRuleMatchEvent_EntityContext_TraceContext {
2722
+ return TraceRuleMatchEvent_EntityContext_TraceContext.fromPartial(base ?? ({} as any));
2723
+ },
2724
+ fromPartial<I extends Exact<DeepPartial<TraceRuleMatchEvent_EntityContext_TraceContext>, I>>(
2725
+ object: I,
2726
+ ): TraceRuleMatchEvent_EntityContext_TraceContext {
2727
+ const message = createBaseTraceRuleMatchEvent_EntityContext_TraceContext();
2728
+ message.traceId = object.traceId ?? "";
2729
+ return message;
2730
+ },
2731
+ };
2732
+
2733
+ /**
2734
+ * RuleGatewayService provides web client access to rule management. Rules come
2735
+ * in two symmetric kinds: trace rules (CEL over finished traces, matches) and
2736
+ * metric rules (PromQL threshold alerting). Metric-rule RPCs are added
2737
+ * alongside these.
2738
+ */
2739
+ export interface RuleGatewayService {
2740
+ /** Trace rule operations */
2741
+ CreateTraceRule(request: CreateTraceRuleRequest, metadata?: Metadata): Promise<CreateTraceRuleResponse>;
2742
+ GetTraceRule(request: GetTraceRuleRequest, metadata?: Metadata): Promise<GetTraceRuleResponse>;
2743
+ ListTraceRules(request: ListTraceRulesRequest, metadata?: Metadata): Promise<ListTraceRulesResponse>;
2744
+ UpdateTraceRule(request: UpdateTraceRuleRequest, metadata?: Metadata): Promise<UpdateTraceRuleResponse>;
2745
+ DeleteTraceRule(request: DeleteTraceRuleRequest, metadata?: Metadata): Promise<DeleteTraceRuleResponse>;
2746
+ /** Trace rule simulation */
2747
+ StreamTraceRuleSimulation(
2748
+ request: StreamTraceRuleSimulationRequest,
2749
+ metadata?: Metadata,
2750
+ ): Observable<TraceRuleSimulationMatch>;
2751
+ /** Trace rule schema discovery */
2752
+ ListTraceRuleSchemas(
2753
+ request: ListTraceRuleSchemasRequest,
2754
+ metadata?: Metadata,
2755
+ ): Promise<ListTraceRuleSchemasResponse>;
2756
+ /**
2757
+ * StreamTraceRuleMatches sends an initial snapshot of recent trace-rule
2758
+ * matches followed by live updates as new matches occur.
2759
+ */
2760
+ StreamTraceRuleMatches(
2761
+ request: StreamTraceRuleMatchesRequest,
2762
+ metadata?: Metadata,
2763
+ ): Observable<TraceRuleMatchEnvelope>;
2764
+ }
2765
+
2766
+ export const RuleGatewayServiceServiceName = "gateway.web.v1.RuleGatewayService";
2767
+ export class RuleGatewayServiceClientImpl implements RuleGatewayService {
2768
+ private readonly rpc: Rpc;
2769
+ private readonly service: string;
2770
+ constructor(rpc: Rpc, opts?: { service?: string }) {
2771
+ this.service = opts?.service || RuleGatewayServiceServiceName;
2772
+ this.rpc = rpc;
2773
+ this.CreateTraceRule = this.CreateTraceRule.bind(this);
2774
+ this.GetTraceRule = this.GetTraceRule.bind(this);
2775
+ this.ListTraceRules = this.ListTraceRules.bind(this);
2776
+ this.UpdateTraceRule = this.UpdateTraceRule.bind(this);
2777
+ this.DeleteTraceRule = this.DeleteTraceRule.bind(this);
2778
+ this.StreamTraceRuleSimulation = this.StreamTraceRuleSimulation.bind(this);
2779
+ this.ListTraceRuleSchemas = this.ListTraceRuleSchemas.bind(this);
2780
+ this.StreamTraceRuleMatches = this.StreamTraceRuleMatches.bind(this);
2781
+ }
2782
+ CreateTraceRule(request: CreateTraceRuleRequest, metadata?: Metadata): Promise<CreateTraceRuleResponse> {
2783
+ const data = CreateTraceRuleRequest.encode(request).finish();
2784
+ const promise = this.rpc.request(this.service, "CreateTraceRule", data, metadata);
2785
+ return promise.then((data) => CreateTraceRuleResponse.decode(new BinaryReader(data)));
2786
+ }
2787
+
2788
+ GetTraceRule(request: GetTraceRuleRequest, metadata?: Metadata): Promise<GetTraceRuleResponse> {
2789
+ const data = GetTraceRuleRequest.encode(request).finish();
2790
+ const promise = this.rpc.request(this.service, "GetTraceRule", data, metadata);
2791
+ return promise.then((data) => GetTraceRuleResponse.decode(new BinaryReader(data)));
2792
+ }
2793
+
2794
+ ListTraceRules(request: ListTraceRulesRequest, metadata?: Metadata): Promise<ListTraceRulesResponse> {
2795
+ const data = ListTraceRulesRequest.encode(request).finish();
2796
+ const promise = this.rpc.request(this.service, "ListTraceRules", data, metadata);
2797
+ return promise.then((data) => ListTraceRulesResponse.decode(new BinaryReader(data)));
2798
+ }
2799
+
2800
+ UpdateTraceRule(request: UpdateTraceRuleRequest, metadata?: Metadata): Promise<UpdateTraceRuleResponse> {
2801
+ const data = UpdateTraceRuleRequest.encode(request).finish();
2802
+ const promise = this.rpc.request(this.service, "UpdateTraceRule", data, metadata);
2803
+ return promise.then((data) => UpdateTraceRuleResponse.decode(new BinaryReader(data)));
2804
+ }
2805
+
2806
+ DeleteTraceRule(request: DeleteTraceRuleRequest, metadata?: Metadata): Promise<DeleteTraceRuleResponse> {
2807
+ const data = DeleteTraceRuleRequest.encode(request).finish();
2808
+ const promise = this.rpc.request(this.service, "DeleteTraceRule", data, metadata);
2809
+ return promise.then((data) => DeleteTraceRuleResponse.decode(new BinaryReader(data)));
2810
+ }
2811
+
2812
+ StreamTraceRuleSimulation(
2813
+ request: StreamTraceRuleSimulationRequest,
2814
+ metadata?: Metadata,
2815
+ ): Observable<TraceRuleSimulationMatch> {
2816
+ const data = StreamTraceRuleSimulationRequest.encode(request).finish();
2817
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamTraceRuleSimulation", data, metadata);
2818
+ return result.pipe(map((data) => TraceRuleSimulationMatch.decode(new BinaryReader(data))));
2819
+ }
2820
+
2821
+ ListTraceRuleSchemas(
2822
+ request: ListTraceRuleSchemasRequest,
2823
+ metadata?: Metadata,
2824
+ ): Promise<ListTraceRuleSchemasResponse> {
2825
+ const data = ListTraceRuleSchemasRequest.encode(request).finish();
2826
+ const promise = this.rpc.request(this.service, "ListTraceRuleSchemas", data, metadata);
2827
+ return promise.then((data) => ListTraceRuleSchemasResponse.decode(new BinaryReader(data)));
2828
+ }
2829
+
2830
+ StreamTraceRuleMatches(
2831
+ request: StreamTraceRuleMatchesRequest,
2832
+ metadata?: Metadata,
2833
+ ): Observable<TraceRuleMatchEnvelope> {
2834
+ const data = StreamTraceRuleMatchesRequest.encode(request).finish();
2835
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamTraceRuleMatches", data, metadata);
2836
+ return result.pipe(map((data) => TraceRuleMatchEnvelope.decode(new BinaryReader(data))));
2837
+ }
2838
+ }
2839
+
2840
+ interface Rpc {
2841
+ request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
2842
+ clientStreamingRequest(
2843
+ service: string,
2844
+ method: string,
2845
+ data: Observable<Uint8Array>,
2846
+ metadata?: Metadata,
2847
+ ): Promise<Uint8Array>;
2848
+ serverStreamingRequest(
2849
+ service: string,
2850
+ method: string,
2851
+ data: Uint8Array,
2852
+ metadata?: Metadata,
2853
+ ): Observable<Uint8Array>;
2854
+ bidirectionalStreamingRequest(
2855
+ service: string,
2856
+ method: string,
2857
+ data: Observable<Uint8Array>,
2858
+ metadata?: Metadata,
2859
+ ): Observable<Uint8Array>;
2860
+ }
2861
+
2862
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
2863
+
2864
+ export type DeepPartial<T> = T extends Builtin ? T
2865
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
2866
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2867
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2868
+ : Partial<T>;
2869
+
2870
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
2871
+ export type Exact<P, I extends P> = P extends Builtin ? P
2872
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
2873
+
2874
+ function toTimestamp(date: Date): Timestamp {
2875
+ const seconds = Math.trunc(date.getTime() / 1_000);
2876
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
2877
+ return { seconds, nanos };
2878
+ }
2879
+
2880
+ function fromTimestamp(t: Timestamp): Date {
2881
+ let millis = (t.seconds || 0) * 1_000;
2882
+ millis += (t.nanos || 0) / 1_000_000;
2883
+ return new globalThis.Date(millis);
2884
+ }
2885
+
2886
+ function fromJsonTimestamp(o: any): Date {
2887
+ if (o instanceof globalThis.Date) {
2888
+ return o;
2889
+ } else if (typeof o === "string") {
2890
+ return new globalThis.Date(o);
2891
+ } else {
2892
+ return fromTimestamp(Timestamp.fromJSON(o));
2893
+ }
2894
+ }
2895
+
2896
+ function isSet(value: any): boolean {
2897
+ return value !== null && value !== undefined;
2898
+ }
2899
+
2900
+ export interface MessageFns<T> {
2901
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
2902
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
2903
+ fromJSON(object: any): T;
2904
+ toJSON(message: T): unknown;
2905
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
2906
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
2907
+ }