@mindburn/helm-ai-kernel 0.5.1

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,1096 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.6
4
+ // protoc v7.34.1
5
+ // source: helm/truth/v1/truth.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { makeGenericClientConstructor, } from "@grpc/grpc-js";
9
+ import { Timestamp } from "../../../google/protobuf/timestamp";
10
+ export const protobufPackage = "helm.truth.v1";
11
+ /**
12
+ * HELM Truth Registry Protocol Buffer Definitions
13
+ *
14
+ * Canonical IDL for versioned truth objects.
15
+ * Stability: v1 additive-only.
16
+ */
17
+ export var TruthType;
18
+ (function (TruthType) {
19
+ TruthType[TruthType["TRUTH_TYPE_UNSPECIFIED"] = 0] = "TRUTH_TYPE_UNSPECIFIED";
20
+ TruthType[TruthType["TRUTH_TYPE_POLICY"] = 1] = "TRUTH_TYPE_POLICY";
21
+ TruthType[TruthType["TRUTH_TYPE_SCHEMA"] = 2] = "TRUTH_TYPE_SCHEMA";
22
+ TruthType[TruthType["TRUTH_TYPE_REGULATION"] = 3] = "TRUTH_TYPE_REGULATION";
23
+ TruthType[TruthType["TRUTH_TYPE_ORG_GENOME"] = 4] = "TRUTH_TYPE_ORG_GENOME";
24
+ TruthType[TruthType["TRUTH_TYPE_PACK_ABI"] = 5] = "TRUTH_TYPE_PACK_ABI";
25
+ TruthType[TruthType["TRUTH_TYPE_ATTESTATION"] = 6] = "TRUTH_TYPE_ATTESTATION";
26
+ TruthType[TruthType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
+ })(TruthType || (TruthType = {}));
28
+ export function truthTypeFromJSON(object) {
29
+ switch (object) {
30
+ case 0:
31
+ case "TRUTH_TYPE_UNSPECIFIED":
32
+ return TruthType.TRUTH_TYPE_UNSPECIFIED;
33
+ case 1:
34
+ case "TRUTH_TYPE_POLICY":
35
+ return TruthType.TRUTH_TYPE_POLICY;
36
+ case 2:
37
+ case "TRUTH_TYPE_SCHEMA":
38
+ return TruthType.TRUTH_TYPE_SCHEMA;
39
+ case 3:
40
+ case "TRUTH_TYPE_REGULATION":
41
+ return TruthType.TRUTH_TYPE_REGULATION;
42
+ case 4:
43
+ case "TRUTH_TYPE_ORG_GENOME":
44
+ return TruthType.TRUTH_TYPE_ORG_GENOME;
45
+ case 5:
46
+ case "TRUTH_TYPE_PACK_ABI":
47
+ return TruthType.TRUTH_TYPE_PACK_ABI;
48
+ case 6:
49
+ case "TRUTH_TYPE_ATTESTATION":
50
+ return TruthType.TRUTH_TYPE_ATTESTATION;
51
+ case -1:
52
+ case "UNRECOGNIZED":
53
+ default:
54
+ return TruthType.UNRECOGNIZED;
55
+ }
56
+ }
57
+ export function truthTypeToJSON(object) {
58
+ switch (object) {
59
+ case TruthType.TRUTH_TYPE_UNSPECIFIED:
60
+ return "TRUTH_TYPE_UNSPECIFIED";
61
+ case TruthType.TRUTH_TYPE_POLICY:
62
+ return "TRUTH_TYPE_POLICY";
63
+ case TruthType.TRUTH_TYPE_SCHEMA:
64
+ return "TRUTH_TYPE_SCHEMA";
65
+ case TruthType.TRUTH_TYPE_REGULATION:
66
+ return "TRUTH_TYPE_REGULATION";
67
+ case TruthType.TRUTH_TYPE_ORG_GENOME:
68
+ return "TRUTH_TYPE_ORG_GENOME";
69
+ case TruthType.TRUTH_TYPE_PACK_ABI:
70
+ return "TRUTH_TYPE_PACK_ABI";
71
+ case TruthType.TRUTH_TYPE_ATTESTATION:
72
+ return "TRUTH_TYPE_ATTESTATION";
73
+ case TruthType.UNRECOGNIZED:
74
+ default:
75
+ return "UNRECOGNIZED";
76
+ }
77
+ }
78
+ function createBaseVersionScope() {
79
+ return { major: 0, minor: 0, patch: 0, epoch: "", label: "" };
80
+ }
81
+ export const VersionScope = {
82
+ encode(message, writer = new BinaryWriter()) {
83
+ if (message.major !== 0) {
84
+ writer.uint32(8).int32(message.major);
85
+ }
86
+ if (message.minor !== 0) {
87
+ writer.uint32(16).int32(message.minor);
88
+ }
89
+ if (message.patch !== 0) {
90
+ writer.uint32(24).int32(message.patch);
91
+ }
92
+ if (message.epoch !== "") {
93
+ writer.uint32(34).string(message.epoch);
94
+ }
95
+ if (message.label !== "") {
96
+ writer.uint32(42).string(message.label);
97
+ }
98
+ return writer;
99
+ },
100
+ decode(input, length) {
101
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
102
+ const end = length === undefined ? reader.len : reader.pos + length;
103
+ const message = createBaseVersionScope();
104
+ while (reader.pos < end) {
105
+ const tag = reader.uint32();
106
+ switch (tag >>> 3) {
107
+ case 1: {
108
+ if (tag !== 8) {
109
+ break;
110
+ }
111
+ message.major = reader.int32();
112
+ continue;
113
+ }
114
+ case 2: {
115
+ if (tag !== 16) {
116
+ break;
117
+ }
118
+ message.minor = reader.int32();
119
+ continue;
120
+ }
121
+ case 3: {
122
+ if (tag !== 24) {
123
+ break;
124
+ }
125
+ message.patch = reader.int32();
126
+ continue;
127
+ }
128
+ case 4: {
129
+ if (tag !== 34) {
130
+ break;
131
+ }
132
+ message.epoch = reader.string();
133
+ continue;
134
+ }
135
+ case 5: {
136
+ if (tag !== 42) {
137
+ break;
138
+ }
139
+ message.label = reader.string();
140
+ continue;
141
+ }
142
+ }
143
+ if ((tag & 7) === 4 || tag === 0) {
144
+ break;
145
+ }
146
+ reader.skip(tag & 7);
147
+ }
148
+ return message;
149
+ },
150
+ fromJSON(object) {
151
+ return {
152
+ major: isSet(object.major) ? globalThis.Number(object.major) : 0,
153
+ minor: isSet(object.minor) ? globalThis.Number(object.minor) : 0,
154
+ patch: isSet(object.patch) ? globalThis.Number(object.patch) : 0,
155
+ epoch: isSet(object.epoch) ? globalThis.String(object.epoch) : "",
156
+ label: isSet(object.label) ? globalThis.String(object.label) : "",
157
+ };
158
+ },
159
+ toJSON(message) {
160
+ const obj = {};
161
+ if (message.major !== 0) {
162
+ obj.major = Math.round(message.major);
163
+ }
164
+ if (message.minor !== 0) {
165
+ obj.minor = Math.round(message.minor);
166
+ }
167
+ if (message.patch !== 0) {
168
+ obj.patch = Math.round(message.patch);
169
+ }
170
+ if (message.epoch !== "") {
171
+ obj.epoch = message.epoch;
172
+ }
173
+ if (message.label !== "") {
174
+ obj.label = message.label;
175
+ }
176
+ return obj;
177
+ },
178
+ create(base) {
179
+ return VersionScope.fromPartial(base ?? {});
180
+ },
181
+ fromPartial(object) {
182
+ const message = createBaseVersionScope();
183
+ message.major = object.major ?? 0;
184
+ message.minor = object.minor ?? 0;
185
+ message.patch = object.patch ?? 0;
186
+ message.epoch = object.epoch ?? "";
187
+ message.label = object.label ?? "";
188
+ return message;
189
+ },
190
+ };
191
+ function createBaseFreshnessInfo() {
192
+ return { lastValidated: undefined, validUntil: undefined, stale: false };
193
+ }
194
+ export const FreshnessInfo = {
195
+ encode(message, writer = new BinaryWriter()) {
196
+ if (message.lastValidated !== undefined) {
197
+ Timestamp.encode(toTimestamp(message.lastValidated), writer.uint32(10).fork()).join();
198
+ }
199
+ if (message.validUntil !== undefined) {
200
+ Timestamp.encode(toTimestamp(message.validUntil), writer.uint32(18).fork()).join();
201
+ }
202
+ if (message.stale !== false) {
203
+ writer.uint32(24).bool(message.stale);
204
+ }
205
+ return writer;
206
+ },
207
+ decode(input, length) {
208
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
209
+ const end = length === undefined ? reader.len : reader.pos + length;
210
+ const message = createBaseFreshnessInfo();
211
+ while (reader.pos < end) {
212
+ const tag = reader.uint32();
213
+ switch (tag >>> 3) {
214
+ case 1: {
215
+ if (tag !== 10) {
216
+ break;
217
+ }
218
+ message.lastValidated = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
219
+ continue;
220
+ }
221
+ case 2: {
222
+ if (tag !== 18) {
223
+ break;
224
+ }
225
+ message.validUntil = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
226
+ continue;
227
+ }
228
+ case 3: {
229
+ if (tag !== 24) {
230
+ break;
231
+ }
232
+ message.stale = reader.bool();
233
+ continue;
234
+ }
235
+ }
236
+ if ((tag & 7) === 4 || tag === 0) {
237
+ break;
238
+ }
239
+ reader.skip(tag & 7);
240
+ }
241
+ return message;
242
+ },
243
+ fromJSON(object) {
244
+ return {
245
+ lastValidated: isSet(object.lastValidated)
246
+ ? fromJsonTimestamp(object.lastValidated)
247
+ : isSet(object.last_validated)
248
+ ? fromJsonTimestamp(object.last_validated)
249
+ : undefined,
250
+ validUntil: isSet(object.validUntil)
251
+ ? fromJsonTimestamp(object.validUntil)
252
+ : isSet(object.valid_until)
253
+ ? fromJsonTimestamp(object.valid_until)
254
+ : undefined,
255
+ stale: isSet(object.stale) ? globalThis.Boolean(object.stale) : false,
256
+ };
257
+ },
258
+ toJSON(message) {
259
+ const obj = {};
260
+ if (message.lastValidated !== undefined) {
261
+ obj.lastValidated = message.lastValidated.toISOString();
262
+ }
263
+ if (message.validUntil !== undefined) {
264
+ obj.validUntil = message.validUntil.toISOString();
265
+ }
266
+ if (message.stale !== false) {
267
+ obj.stale = message.stale;
268
+ }
269
+ return obj;
270
+ },
271
+ create(base) {
272
+ return FreshnessInfo.fromPartial(base ?? {});
273
+ },
274
+ fromPartial(object) {
275
+ const message = createBaseFreshnessInfo();
276
+ message.lastValidated = object.lastValidated ?? undefined;
277
+ message.validUntil = object.validUntil ?? undefined;
278
+ message.stale = object.stale ?? false;
279
+ return message;
280
+ },
281
+ };
282
+ function createBaseCompatibilityInfo() {
283
+ return { breakingChange: false, deprecatedSince: "", replacedBy: "", compatibleWith: [] };
284
+ }
285
+ export const CompatibilityInfo = {
286
+ encode(message, writer = new BinaryWriter()) {
287
+ if (message.breakingChange !== false) {
288
+ writer.uint32(8).bool(message.breakingChange);
289
+ }
290
+ if (message.deprecatedSince !== "") {
291
+ writer.uint32(18).string(message.deprecatedSince);
292
+ }
293
+ if (message.replacedBy !== "") {
294
+ writer.uint32(26).string(message.replacedBy);
295
+ }
296
+ for (const v of message.compatibleWith) {
297
+ writer.uint32(34).string(v);
298
+ }
299
+ return writer;
300
+ },
301
+ decode(input, length) {
302
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
303
+ const end = length === undefined ? reader.len : reader.pos + length;
304
+ const message = createBaseCompatibilityInfo();
305
+ while (reader.pos < end) {
306
+ const tag = reader.uint32();
307
+ switch (tag >>> 3) {
308
+ case 1: {
309
+ if (tag !== 8) {
310
+ break;
311
+ }
312
+ message.breakingChange = reader.bool();
313
+ continue;
314
+ }
315
+ case 2: {
316
+ if (tag !== 18) {
317
+ break;
318
+ }
319
+ message.deprecatedSince = reader.string();
320
+ continue;
321
+ }
322
+ case 3: {
323
+ if (tag !== 26) {
324
+ break;
325
+ }
326
+ message.replacedBy = reader.string();
327
+ continue;
328
+ }
329
+ case 4: {
330
+ if (tag !== 34) {
331
+ break;
332
+ }
333
+ message.compatibleWith.push(reader.string());
334
+ continue;
335
+ }
336
+ }
337
+ if ((tag & 7) === 4 || tag === 0) {
338
+ break;
339
+ }
340
+ reader.skip(tag & 7);
341
+ }
342
+ return message;
343
+ },
344
+ fromJSON(object) {
345
+ return {
346
+ breakingChange: isSet(object.breakingChange)
347
+ ? globalThis.Boolean(object.breakingChange)
348
+ : isSet(object.breaking_change)
349
+ ? globalThis.Boolean(object.breaking_change)
350
+ : false,
351
+ deprecatedSince: isSet(object.deprecatedSince)
352
+ ? globalThis.String(object.deprecatedSince)
353
+ : isSet(object.deprecated_since)
354
+ ? globalThis.String(object.deprecated_since)
355
+ : "",
356
+ replacedBy: isSet(object.replacedBy)
357
+ ? globalThis.String(object.replacedBy)
358
+ : isSet(object.replaced_by)
359
+ ? globalThis.String(object.replaced_by)
360
+ : "",
361
+ compatibleWith: globalThis.Array.isArray(object?.compatibleWith)
362
+ ? object.compatibleWith.map((e) => globalThis.String(e))
363
+ : globalThis.Array.isArray(object?.compatible_with)
364
+ ? object.compatible_with.map((e) => globalThis.String(e))
365
+ : [],
366
+ };
367
+ },
368
+ toJSON(message) {
369
+ const obj = {};
370
+ if (message.breakingChange !== false) {
371
+ obj.breakingChange = message.breakingChange;
372
+ }
373
+ if (message.deprecatedSince !== "") {
374
+ obj.deprecatedSince = message.deprecatedSince;
375
+ }
376
+ if (message.replacedBy !== "") {
377
+ obj.replacedBy = message.replacedBy;
378
+ }
379
+ if (message.compatibleWith?.length) {
380
+ obj.compatibleWith = message.compatibleWith;
381
+ }
382
+ return obj;
383
+ },
384
+ create(base) {
385
+ return CompatibilityInfo.fromPartial(base ?? {});
386
+ },
387
+ fromPartial(object) {
388
+ const message = createBaseCompatibilityInfo();
389
+ message.breakingChange = object.breakingChange ?? false;
390
+ message.deprecatedSince = object.deprecatedSince ?? "";
391
+ message.replacedBy = object.replacedBy ?? "";
392
+ message.compatibleWith = object.compatibleWith?.map((e) => e) || [];
393
+ return message;
394
+ },
395
+ };
396
+ function createBaseProvenanceInfo() {
397
+ return { authorId: "", sourceRef: "", tool: "" };
398
+ }
399
+ export const ProvenanceInfo = {
400
+ encode(message, writer = new BinaryWriter()) {
401
+ if (message.authorId !== "") {
402
+ writer.uint32(10).string(message.authorId);
403
+ }
404
+ if (message.sourceRef !== "") {
405
+ writer.uint32(18).string(message.sourceRef);
406
+ }
407
+ if (message.tool !== "") {
408
+ writer.uint32(26).string(message.tool);
409
+ }
410
+ return writer;
411
+ },
412
+ decode(input, length) {
413
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
414
+ const end = length === undefined ? reader.len : reader.pos + length;
415
+ const message = createBaseProvenanceInfo();
416
+ while (reader.pos < end) {
417
+ const tag = reader.uint32();
418
+ switch (tag >>> 3) {
419
+ case 1: {
420
+ if (tag !== 10) {
421
+ break;
422
+ }
423
+ message.authorId = reader.string();
424
+ continue;
425
+ }
426
+ case 2: {
427
+ if (tag !== 18) {
428
+ break;
429
+ }
430
+ message.sourceRef = reader.string();
431
+ continue;
432
+ }
433
+ case 3: {
434
+ if (tag !== 26) {
435
+ break;
436
+ }
437
+ message.tool = reader.string();
438
+ continue;
439
+ }
440
+ }
441
+ if ((tag & 7) === 4 || tag === 0) {
442
+ break;
443
+ }
444
+ reader.skip(tag & 7);
445
+ }
446
+ return message;
447
+ },
448
+ fromJSON(object) {
449
+ return {
450
+ authorId: isSet(object.authorId)
451
+ ? globalThis.String(object.authorId)
452
+ : isSet(object.author_id)
453
+ ? globalThis.String(object.author_id)
454
+ : "",
455
+ sourceRef: isSet(object.sourceRef)
456
+ ? globalThis.String(object.sourceRef)
457
+ : isSet(object.source_ref)
458
+ ? globalThis.String(object.source_ref)
459
+ : "",
460
+ tool: isSet(object.tool) ? globalThis.String(object.tool) : "",
461
+ };
462
+ },
463
+ toJSON(message) {
464
+ const obj = {};
465
+ if (message.authorId !== "") {
466
+ obj.authorId = message.authorId;
467
+ }
468
+ if (message.sourceRef !== "") {
469
+ obj.sourceRef = message.sourceRef;
470
+ }
471
+ if (message.tool !== "") {
472
+ obj.tool = message.tool;
473
+ }
474
+ return obj;
475
+ },
476
+ create(base) {
477
+ return ProvenanceInfo.fromPartial(base ?? {});
478
+ },
479
+ fromPartial(object) {
480
+ const message = createBaseProvenanceInfo();
481
+ message.authorId = object.authorId ?? "";
482
+ message.sourceRef = object.sourceRef ?? "";
483
+ message.tool = object.tool ?? "";
484
+ return message;
485
+ },
486
+ };
487
+ function createBaseTruthObject() {
488
+ return {
489
+ objectId: "",
490
+ type: 0,
491
+ name: "",
492
+ version: undefined,
493
+ content: new Uint8Array(0),
494
+ contentHash: "",
495
+ freshness: undefined,
496
+ compatibility: undefined,
497
+ provenance: undefined,
498
+ registeredAt: undefined,
499
+ signature: "",
500
+ };
501
+ }
502
+ export const TruthObject = {
503
+ encode(message, writer = new BinaryWriter()) {
504
+ if (message.objectId !== "") {
505
+ writer.uint32(10).string(message.objectId);
506
+ }
507
+ if (message.type !== 0) {
508
+ writer.uint32(16).int32(message.type);
509
+ }
510
+ if (message.name !== "") {
511
+ writer.uint32(26).string(message.name);
512
+ }
513
+ if (message.version !== undefined) {
514
+ VersionScope.encode(message.version, writer.uint32(34).fork()).join();
515
+ }
516
+ if (message.content.length !== 0) {
517
+ writer.uint32(42).bytes(message.content);
518
+ }
519
+ if (message.contentHash !== "") {
520
+ writer.uint32(50).string(message.contentHash);
521
+ }
522
+ if (message.freshness !== undefined) {
523
+ FreshnessInfo.encode(message.freshness, writer.uint32(58).fork()).join();
524
+ }
525
+ if (message.compatibility !== undefined) {
526
+ CompatibilityInfo.encode(message.compatibility, writer.uint32(66).fork()).join();
527
+ }
528
+ if (message.provenance !== undefined) {
529
+ ProvenanceInfo.encode(message.provenance, writer.uint32(74).fork()).join();
530
+ }
531
+ if (message.registeredAt !== undefined) {
532
+ Timestamp.encode(toTimestamp(message.registeredAt), writer.uint32(82).fork()).join();
533
+ }
534
+ if (message.signature !== "") {
535
+ writer.uint32(90).string(message.signature);
536
+ }
537
+ return writer;
538
+ },
539
+ decode(input, length) {
540
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
541
+ const end = length === undefined ? reader.len : reader.pos + length;
542
+ const message = createBaseTruthObject();
543
+ while (reader.pos < end) {
544
+ const tag = reader.uint32();
545
+ switch (tag >>> 3) {
546
+ case 1: {
547
+ if (tag !== 10) {
548
+ break;
549
+ }
550
+ message.objectId = reader.string();
551
+ continue;
552
+ }
553
+ case 2: {
554
+ if (tag !== 16) {
555
+ break;
556
+ }
557
+ message.type = reader.int32();
558
+ continue;
559
+ }
560
+ case 3: {
561
+ if (tag !== 26) {
562
+ break;
563
+ }
564
+ message.name = reader.string();
565
+ continue;
566
+ }
567
+ case 4: {
568
+ if (tag !== 34) {
569
+ break;
570
+ }
571
+ message.version = VersionScope.decode(reader, reader.uint32());
572
+ continue;
573
+ }
574
+ case 5: {
575
+ if (tag !== 42) {
576
+ break;
577
+ }
578
+ message.content = reader.bytes();
579
+ continue;
580
+ }
581
+ case 6: {
582
+ if (tag !== 50) {
583
+ break;
584
+ }
585
+ message.contentHash = reader.string();
586
+ continue;
587
+ }
588
+ case 7: {
589
+ if (tag !== 58) {
590
+ break;
591
+ }
592
+ message.freshness = FreshnessInfo.decode(reader, reader.uint32());
593
+ continue;
594
+ }
595
+ case 8: {
596
+ if (tag !== 66) {
597
+ break;
598
+ }
599
+ message.compatibility = CompatibilityInfo.decode(reader, reader.uint32());
600
+ continue;
601
+ }
602
+ case 9: {
603
+ if (tag !== 74) {
604
+ break;
605
+ }
606
+ message.provenance = ProvenanceInfo.decode(reader, reader.uint32());
607
+ continue;
608
+ }
609
+ case 10: {
610
+ if (tag !== 82) {
611
+ break;
612
+ }
613
+ message.registeredAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
614
+ continue;
615
+ }
616
+ case 11: {
617
+ if (tag !== 90) {
618
+ break;
619
+ }
620
+ message.signature = reader.string();
621
+ continue;
622
+ }
623
+ }
624
+ if ((tag & 7) === 4 || tag === 0) {
625
+ break;
626
+ }
627
+ reader.skip(tag & 7);
628
+ }
629
+ return message;
630
+ },
631
+ fromJSON(object) {
632
+ return {
633
+ objectId: isSet(object.objectId)
634
+ ? globalThis.String(object.objectId)
635
+ : isSet(object.object_id)
636
+ ? globalThis.String(object.object_id)
637
+ : "",
638
+ type: isSet(object.type) ? truthTypeFromJSON(object.type) : 0,
639
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
640
+ version: isSet(object.version) ? VersionScope.fromJSON(object.version) : undefined,
641
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
642
+ contentHash: isSet(object.contentHash)
643
+ ? globalThis.String(object.contentHash)
644
+ : isSet(object.content_hash)
645
+ ? globalThis.String(object.content_hash)
646
+ : "",
647
+ freshness: isSet(object.freshness) ? FreshnessInfo.fromJSON(object.freshness) : undefined,
648
+ compatibility: isSet(object.compatibility) ? CompatibilityInfo.fromJSON(object.compatibility) : undefined,
649
+ provenance: isSet(object.provenance) ? ProvenanceInfo.fromJSON(object.provenance) : undefined,
650
+ registeredAt: isSet(object.registeredAt)
651
+ ? fromJsonTimestamp(object.registeredAt)
652
+ : isSet(object.registered_at)
653
+ ? fromJsonTimestamp(object.registered_at)
654
+ : undefined,
655
+ signature: isSet(object.signature) ? globalThis.String(object.signature) : "",
656
+ };
657
+ },
658
+ toJSON(message) {
659
+ const obj = {};
660
+ if (message.objectId !== "") {
661
+ obj.objectId = message.objectId;
662
+ }
663
+ if (message.type !== 0) {
664
+ obj.type = truthTypeToJSON(message.type);
665
+ }
666
+ if (message.name !== "") {
667
+ obj.name = message.name;
668
+ }
669
+ if (message.version !== undefined) {
670
+ obj.version = VersionScope.toJSON(message.version);
671
+ }
672
+ if (message.content.length !== 0) {
673
+ obj.content = base64FromBytes(message.content);
674
+ }
675
+ if (message.contentHash !== "") {
676
+ obj.contentHash = message.contentHash;
677
+ }
678
+ if (message.freshness !== undefined) {
679
+ obj.freshness = FreshnessInfo.toJSON(message.freshness);
680
+ }
681
+ if (message.compatibility !== undefined) {
682
+ obj.compatibility = CompatibilityInfo.toJSON(message.compatibility);
683
+ }
684
+ if (message.provenance !== undefined) {
685
+ obj.provenance = ProvenanceInfo.toJSON(message.provenance);
686
+ }
687
+ if (message.registeredAt !== undefined) {
688
+ obj.registeredAt = message.registeredAt.toISOString();
689
+ }
690
+ if (message.signature !== "") {
691
+ obj.signature = message.signature;
692
+ }
693
+ return obj;
694
+ },
695
+ create(base) {
696
+ return TruthObject.fromPartial(base ?? {});
697
+ },
698
+ fromPartial(object) {
699
+ const message = createBaseTruthObject();
700
+ message.objectId = object.objectId ?? "";
701
+ message.type = object.type ?? 0;
702
+ message.name = object.name ?? "";
703
+ message.version = (object.version !== undefined && object.version !== null)
704
+ ? VersionScope.fromPartial(object.version)
705
+ : undefined;
706
+ message.content = object.content ?? new Uint8Array(0);
707
+ message.contentHash = object.contentHash ?? "";
708
+ message.freshness = (object.freshness !== undefined && object.freshness !== null)
709
+ ? FreshnessInfo.fromPartial(object.freshness)
710
+ : undefined;
711
+ message.compatibility = (object.compatibility !== undefined && object.compatibility !== null)
712
+ ? CompatibilityInfo.fromPartial(object.compatibility)
713
+ : undefined;
714
+ message.provenance = (object.provenance !== undefined && object.provenance !== null)
715
+ ? ProvenanceInfo.fromPartial(object.provenance)
716
+ : undefined;
717
+ message.registeredAt = object.registeredAt ?? undefined;
718
+ message.signature = object.signature ?? "";
719
+ return message;
720
+ },
721
+ };
722
+ function createBaseLineageEntry() {
723
+ return {
724
+ entryId: "",
725
+ objectId: "",
726
+ parentId: "",
727
+ relation: "",
728
+ annotation: "",
729
+ recordedAt: undefined,
730
+ recordedBy: "",
731
+ };
732
+ }
733
+ export const LineageEntry = {
734
+ encode(message, writer = new BinaryWriter()) {
735
+ if (message.entryId !== "") {
736
+ writer.uint32(10).string(message.entryId);
737
+ }
738
+ if (message.objectId !== "") {
739
+ writer.uint32(18).string(message.objectId);
740
+ }
741
+ if (message.parentId !== "") {
742
+ writer.uint32(26).string(message.parentId);
743
+ }
744
+ if (message.relation !== "") {
745
+ writer.uint32(34).string(message.relation);
746
+ }
747
+ if (message.annotation !== "") {
748
+ writer.uint32(42).string(message.annotation);
749
+ }
750
+ if (message.recordedAt !== undefined) {
751
+ Timestamp.encode(toTimestamp(message.recordedAt), writer.uint32(50).fork()).join();
752
+ }
753
+ if (message.recordedBy !== "") {
754
+ writer.uint32(58).string(message.recordedBy);
755
+ }
756
+ return writer;
757
+ },
758
+ decode(input, length) {
759
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
760
+ const end = length === undefined ? reader.len : reader.pos + length;
761
+ const message = createBaseLineageEntry();
762
+ while (reader.pos < end) {
763
+ const tag = reader.uint32();
764
+ switch (tag >>> 3) {
765
+ case 1: {
766
+ if (tag !== 10) {
767
+ break;
768
+ }
769
+ message.entryId = reader.string();
770
+ continue;
771
+ }
772
+ case 2: {
773
+ if (tag !== 18) {
774
+ break;
775
+ }
776
+ message.objectId = reader.string();
777
+ continue;
778
+ }
779
+ case 3: {
780
+ if (tag !== 26) {
781
+ break;
782
+ }
783
+ message.parentId = reader.string();
784
+ continue;
785
+ }
786
+ case 4: {
787
+ if (tag !== 34) {
788
+ break;
789
+ }
790
+ message.relation = reader.string();
791
+ continue;
792
+ }
793
+ case 5: {
794
+ if (tag !== 42) {
795
+ break;
796
+ }
797
+ message.annotation = reader.string();
798
+ continue;
799
+ }
800
+ case 6: {
801
+ if (tag !== 50) {
802
+ break;
803
+ }
804
+ message.recordedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
805
+ continue;
806
+ }
807
+ case 7: {
808
+ if (tag !== 58) {
809
+ break;
810
+ }
811
+ message.recordedBy = reader.string();
812
+ continue;
813
+ }
814
+ }
815
+ if ((tag & 7) === 4 || tag === 0) {
816
+ break;
817
+ }
818
+ reader.skip(tag & 7);
819
+ }
820
+ return message;
821
+ },
822
+ fromJSON(object) {
823
+ return {
824
+ entryId: isSet(object.entryId)
825
+ ? globalThis.String(object.entryId)
826
+ : isSet(object.entry_id)
827
+ ? globalThis.String(object.entry_id)
828
+ : "",
829
+ objectId: isSet(object.objectId)
830
+ ? globalThis.String(object.objectId)
831
+ : isSet(object.object_id)
832
+ ? globalThis.String(object.object_id)
833
+ : "",
834
+ parentId: isSet(object.parentId)
835
+ ? globalThis.String(object.parentId)
836
+ : isSet(object.parent_id)
837
+ ? globalThis.String(object.parent_id)
838
+ : "",
839
+ relation: isSet(object.relation) ? globalThis.String(object.relation) : "",
840
+ annotation: isSet(object.annotation) ? globalThis.String(object.annotation) : "",
841
+ recordedAt: isSet(object.recordedAt)
842
+ ? fromJsonTimestamp(object.recordedAt)
843
+ : isSet(object.recorded_at)
844
+ ? fromJsonTimestamp(object.recorded_at)
845
+ : undefined,
846
+ recordedBy: isSet(object.recordedBy)
847
+ ? globalThis.String(object.recordedBy)
848
+ : isSet(object.recorded_by)
849
+ ? globalThis.String(object.recorded_by)
850
+ : "",
851
+ };
852
+ },
853
+ toJSON(message) {
854
+ const obj = {};
855
+ if (message.entryId !== "") {
856
+ obj.entryId = message.entryId;
857
+ }
858
+ if (message.objectId !== "") {
859
+ obj.objectId = message.objectId;
860
+ }
861
+ if (message.parentId !== "") {
862
+ obj.parentId = message.parentId;
863
+ }
864
+ if (message.relation !== "") {
865
+ obj.relation = message.relation;
866
+ }
867
+ if (message.annotation !== "") {
868
+ obj.annotation = message.annotation;
869
+ }
870
+ if (message.recordedAt !== undefined) {
871
+ obj.recordedAt = message.recordedAt.toISOString();
872
+ }
873
+ if (message.recordedBy !== "") {
874
+ obj.recordedBy = message.recordedBy;
875
+ }
876
+ return obj;
877
+ },
878
+ create(base) {
879
+ return LineageEntry.fromPartial(base ?? {});
880
+ },
881
+ fromPartial(object) {
882
+ const message = createBaseLineageEntry();
883
+ message.entryId = object.entryId ?? "";
884
+ message.objectId = object.objectId ?? "";
885
+ message.parentId = object.parentId ?? "";
886
+ message.relation = object.relation ?? "";
887
+ message.annotation = object.annotation ?? "";
888
+ message.recordedAt = object.recordedAt ?? undefined;
889
+ message.recordedBy = object.recordedBy ?? "";
890
+ return message;
891
+ },
892
+ };
893
+ function createBaseGetTruthRequest() {
894
+ return { objectId: "" };
895
+ }
896
+ export const GetTruthRequest = {
897
+ encode(message, writer = new BinaryWriter()) {
898
+ if (message.objectId !== "") {
899
+ writer.uint32(10).string(message.objectId);
900
+ }
901
+ return writer;
902
+ },
903
+ decode(input, length) {
904
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
905
+ const end = length === undefined ? reader.len : reader.pos + length;
906
+ const message = createBaseGetTruthRequest();
907
+ while (reader.pos < end) {
908
+ const tag = reader.uint32();
909
+ switch (tag >>> 3) {
910
+ case 1: {
911
+ if (tag !== 10) {
912
+ break;
913
+ }
914
+ message.objectId = reader.string();
915
+ continue;
916
+ }
917
+ }
918
+ if ((tag & 7) === 4 || tag === 0) {
919
+ break;
920
+ }
921
+ reader.skip(tag & 7);
922
+ }
923
+ return message;
924
+ },
925
+ fromJSON(object) {
926
+ return {
927
+ objectId: isSet(object.objectId)
928
+ ? globalThis.String(object.objectId)
929
+ : isSet(object.object_id)
930
+ ? globalThis.String(object.object_id)
931
+ : "",
932
+ };
933
+ },
934
+ toJSON(message) {
935
+ const obj = {};
936
+ if (message.objectId !== "") {
937
+ obj.objectId = message.objectId;
938
+ }
939
+ return obj;
940
+ },
941
+ create(base) {
942
+ return GetTruthRequest.fromPartial(base ?? {});
943
+ },
944
+ fromPartial(object) {
945
+ const message = createBaseGetTruthRequest();
946
+ message.objectId = object.objectId ?? "";
947
+ return message;
948
+ },
949
+ };
950
+ function createBaseGetLatestTruthRequest() {
951
+ return { type: 0, name: "" };
952
+ }
953
+ export const GetLatestTruthRequest = {
954
+ encode(message, writer = new BinaryWriter()) {
955
+ if (message.type !== 0) {
956
+ writer.uint32(8).int32(message.type);
957
+ }
958
+ if (message.name !== "") {
959
+ writer.uint32(18).string(message.name);
960
+ }
961
+ return writer;
962
+ },
963
+ decode(input, length) {
964
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
965
+ const end = length === undefined ? reader.len : reader.pos + length;
966
+ const message = createBaseGetLatestTruthRequest();
967
+ while (reader.pos < end) {
968
+ const tag = reader.uint32();
969
+ switch (tag >>> 3) {
970
+ case 1: {
971
+ if (tag !== 8) {
972
+ break;
973
+ }
974
+ message.type = reader.int32();
975
+ continue;
976
+ }
977
+ case 2: {
978
+ if (tag !== 18) {
979
+ break;
980
+ }
981
+ message.name = reader.string();
982
+ continue;
983
+ }
984
+ }
985
+ if ((tag & 7) === 4 || tag === 0) {
986
+ break;
987
+ }
988
+ reader.skip(tag & 7);
989
+ }
990
+ return message;
991
+ },
992
+ fromJSON(object) {
993
+ return {
994
+ type: isSet(object.type) ? truthTypeFromJSON(object.type) : 0,
995
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
996
+ };
997
+ },
998
+ toJSON(message) {
999
+ const obj = {};
1000
+ if (message.type !== 0) {
1001
+ obj.type = truthTypeToJSON(message.type);
1002
+ }
1003
+ if (message.name !== "") {
1004
+ obj.name = message.name;
1005
+ }
1006
+ return obj;
1007
+ },
1008
+ create(base) {
1009
+ return GetLatestTruthRequest.fromPartial(base ?? {});
1010
+ },
1011
+ fromPartial(object) {
1012
+ const message = createBaseGetLatestTruthRequest();
1013
+ message.type = object.type ?? 0;
1014
+ message.name = object.name ?? "";
1015
+ return message;
1016
+ },
1017
+ };
1018
+ export const TruthRegistryServiceService = {
1019
+ register: {
1020
+ path: "/helm.truth.v1.TruthRegistryService/Register",
1021
+ requestStream: false,
1022
+ responseStream: false,
1023
+ requestSerialize: (value) => Buffer.from(TruthObject.encode(value).finish()),
1024
+ requestDeserialize: (value) => TruthObject.decode(value),
1025
+ responseSerialize: (value) => Buffer.from(TruthObject.encode(value).finish()),
1026
+ responseDeserialize: (value) => TruthObject.decode(value),
1027
+ },
1028
+ get: {
1029
+ path: "/helm.truth.v1.TruthRegistryService/Get",
1030
+ requestStream: false,
1031
+ responseStream: false,
1032
+ requestSerialize: (value) => Buffer.from(GetTruthRequest.encode(value).finish()),
1033
+ requestDeserialize: (value) => GetTruthRequest.decode(value),
1034
+ responseSerialize: (value) => Buffer.from(TruthObject.encode(value).finish()),
1035
+ responseDeserialize: (value) => TruthObject.decode(value),
1036
+ },
1037
+ getLatest: {
1038
+ path: "/helm.truth.v1.TruthRegistryService/GetLatest",
1039
+ requestStream: false,
1040
+ responseStream: false,
1041
+ requestSerialize: (value) => Buffer.from(GetLatestTruthRequest.encode(value).finish()),
1042
+ requestDeserialize: (value) => GetLatestTruthRequest.decode(value),
1043
+ responseSerialize: (value) => Buffer.from(TruthObject.encode(value).finish()),
1044
+ responseDeserialize: (value) => TruthObject.decode(value),
1045
+ },
1046
+ };
1047
+ export const TruthRegistryServiceClient = makeGenericClientConstructor(TruthRegistryServiceService, "helm.truth.v1.TruthRegistryService");
1048
+ function bytesFromBase64(b64) {
1049
+ if (globalThis.Buffer) {
1050
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1051
+ }
1052
+ else {
1053
+ const bin = globalThis.atob(b64);
1054
+ const arr = new Uint8Array(bin.length);
1055
+ for (let i = 0; i < bin.length; ++i) {
1056
+ arr[i] = bin.charCodeAt(i);
1057
+ }
1058
+ return arr;
1059
+ }
1060
+ }
1061
+ function base64FromBytes(arr) {
1062
+ if (globalThis.Buffer) {
1063
+ return globalThis.Buffer.from(arr).toString("base64");
1064
+ }
1065
+ else {
1066
+ const bin = [];
1067
+ arr.forEach((byte) => {
1068
+ bin.push(globalThis.String.fromCharCode(byte));
1069
+ });
1070
+ return globalThis.btoa(bin.join(""));
1071
+ }
1072
+ }
1073
+ function toTimestamp(date) {
1074
+ const seconds = Math.trunc(date.getTime() / 1_000);
1075
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1076
+ return { seconds, nanos };
1077
+ }
1078
+ function fromTimestamp(t) {
1079
+ let millis = (t.seconds || 0) * 1_000;
1080
+ millis += (t.nanos || 0) / 1_000_000;
1081
+ return new globalThis.Date(millis);
1082
+ }
1083
+ function fromJsonTimestamp(o) {
1084
+ if (o instanceof globalThis.Date) {
1085
+ return o;
1086
+ }
1087
+ else if (typeof o === "string") {
1088
+ return new globalThis.Date(o);
1089
+ }
1090
+ else {
1091
+ return fromTimestamp(Timestamp.fromJSON(o));
1092
+ }
1093
+ }
1094
+ function isSet(value) {
1095
+ return value !== null && value !== undefined;
1096
+ }