@reallyme/codec 0.1.9

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,492 @@
1
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Message } from "@bufbuild/protobuf";
3
+ /**
4
+ * Describes the file reallyme/codec/v1/codec.proto.
5
+ */
6
+ export declare const file_reallyme_codec_v1_codec: GenFile;
7
+ /**
8
+ * CodecError is the public, non-PII error envelope for codec boundary failures.
9
+ * The oneof keeps base encoding, PEM, multiformat, and canonicalization
10
+ * failures distinct while the shared CodecErrorReason enum provides stable
11
+ * cross-language reason codes.
12
+ *
13
+ * @generated from message reallyme.codec.v1.CodecError
14
+ */
15
+ export type CodecError = Message<"reallyme.codec.v1.CodecError"> & {
16
+ /**
17
+ * @generated from oneof reallyme.codec.v1.CodecError.error
18
+ */
19
+ error: {
20
+ /**
21
+ * @generated from field: reallyme.codec.v1.CodecBaseEncodingError base_encoding = 1;
22
+ */
23
+ value: CodecBaseEncodingError;
24
+ case: "baseEncoding";
25
+ } | {
26
+ /**
27
+ * @generated from field: reallyme.codec.v1.CodecPemError pem = 2;
28
+ */
29
+ value: CodecPemError;
30
+ case: "pem";
31
+ } | {
32
+ /**
33
+ * @generated from field: reallyme.codec.v1.CodecMultiformatError multiformat = 3;
34
+ */
35
+ value: CodecMultiformatError;
36
+ case: "multiformat";
37
+ } | {
38
+ /**
39
+ * @generated from field: reallyme.codec.v1.CodecCanonicalizationError canonicalization = 4;
40
+ */
41
+ value: CodecCanonicalizationError;
42
+ case: "canonicalization";
43
+ } | {
44
+ case: undefined;
45
+ value?: undefined;
46
+ };
47
+ };
48
+ /**
49
+ * Describes the message reallyme.codec.v1.CodecError.
50
+ * Use `create(CodecErrorSchema)` to create a new message.
51
+ */
52
+ export declare const CodecErrorSchema: GenMessage<CodecError>;
53
+ /**
54
+ * CodecMulticodecSpec is the protobuf form of a multicodec table entry.
55
+ *
56
+ * @generated from message reallyme.codec.v1.CodecMulticodecSpec
57
+ */
58
+ export type CodecMulticodecSpec = Message<"reallyme.codec.v1.CodecMulticodecSpec"> & {
59
+ /**
60
+ * @generated from field: string name = 1;
61
+ */
62
+ name: string;
63
+ /**
64
+ * Raw multicodec varint bytes for callers that need the numeric code
65
+ * encoding independent of any payload.
66
+ *
67
+ * @generated from field: bytes code = 2;
68
+ */
69
+ code: Uint8Array;
70
+ /**
71
+ * Prefix bytes to match or prepend on encoded values. For currently
72
+ * supported codecs this is identical to code, but it is kept separate so
73
+ * consumers can use semantic field names without deriving one from the
74
+ * other.
75
+ *
76
+ * @generated from field: bytes prefix = 3;
77
+ */
78
+ prefix: Uint8Array;
79
+ /**
80
+ * @generated from field: reallyme.codec.v1.CodecTag tag = 4;
81
+ */
82
+ tag: CodecTag;
83
+ /**
84
+ * @generated from field: reallyme.codec.v1.CodecKeyMaterialKind key_material_kind = 5;
85
+ */
86
+ keyMaterialKind: CodecKeyMaterialKind;
87
+ /**
88
+ * @generated from field: uint32 fixed_length = 6;
89
+ */
90
+ fixedLength: number;
91
+ /**
92
+ * @generated from field: bool variable_length = 7;
93
+ */
94
+ variableLength: boolean;
95
+ /**
96
+ * @generated from field: string algorithm_name = 8;
97
+ */
98
+ algorithmName: string;
99
+ };
100
+ /**
101
+ * Describes the message reallyme.codec.v1.CodecMulticodecSpec.
102
+ * Use `create(CodecMulticodecSpecSchema)` to create a new message.
103
+ */
104
+ export declare const CodecMulticodecSpecSchema: GenMessage<CodecMulticodecSpec>;
105
+ /**
106
+ * CodecMulticodecLookupResult is returned when bytes are matched against the
107
+ * supported multicodec prefix table.
108
+ *
109
+ * @generated from message reallyme.codec.v1.CodecMulticodecLookupResult
110
+ */
111
+ export type CodecMulticodecLookupResult = Message<"reallyme.codec.v1.CodecMulticodecLookupResult"> & {
112
+ /**
113
+ * @generated from field: string name = 1;
114
+ */
115
+ name: string;
116
+ /**
117
+ * @generated from field: uint32 prefix_length = 2;
118
+ */
119
+ prefixLength: number;
120
+ /**
121
+ * @generated from field: reallyme.codec.v1.CodecMulticodecSpec metadata = 3;
122
+ */
123
+ metadata?: CodecMulticodecSpec | undefined;
124
+ };
125
+ /**
126
+ * Describes the message reallyme.codec.v1.CodecMulticodecLookupResult.
127
+ * Use `create(CodecMulticodecLookupResultSchema)` to create a new message.
128
+ */
129
+ export declare const CodecMulticodecLookupResultSchema: GenMessage<CodecMulticodecLookupResult>;
130
+ /**
131
+ * CodecMulticodecTableResult contains the supported multicodec entries.
132
+ *
133
+ * @generated from message reallyme.codec.v1.CodecMulticodecTableResult
134
+ */
135
+ export type CodecMulticodecTableResult = Message<"reallyme.codec.v1.CodecMulticodecTableResult"> & {
136
+ /**
137
+ * @generated from field: repeated reallyme.codec.v1.CodecMulticodecSpec entries = 1;
138
+ */
139
+ entries: CodecMulticodecSpec[];
140
+ };
141
+ /**
142
+ * Describes the message reallyme.codec.v1.CodecMulticodecTableResult.
143
+ * Use `create(CodecMulticodecTableResultSchema)` to create a new message.
144
+ */
145
+ export declare const CodecMulticodecTableResultSchema: GenMessage<CodecMulticodecTableResult>;
146
+ /**
147
+ * CodecMultikeyParseResult is the binary/protobuf form of multikey parsing.
148
+ *
149
+ * @generated from message reallyme.codec.v1.CodecMultikeyParseResult
150
+ */
151
+ export type CodecMultikeyParseResult = Message<"reallyme.codec.v1.CodecMultikeyParseResult"> & {
152
+ /**
153
+ * @generated from field: string codec_name = 1;
154
+ */
155
+ codecName: string;
156
+ /**
157
+ * @generated from field: string algorithm_name = 2;
158
+ */
159
+ algorithmName: string;
160
+ /**
161
+ * @generated from field: bytes public_key = 3;
162
+ */
163
+ publicKey: Uint8Array;
164
+ /**
165
+ * @generated from field: uint32 expected_public_key_length = 4;
166
+ */
167
+ expectedPublicKeyLength: number;
168
+ /**
169
+ * @generated from field: bool variable_public_key_length = 5;
170
+ */
171
+ variablePublicKeyLength: boolean;
172
+ };
173
+ /**
174
+ * Describes the message reallyme.codec.v1.CodecMultikeyParseResult.
175
+ * Use `create(CodecMultikeyParseResultSchema)` to create a new message.
176
+ */
177
+ export declare const CodecMultikeyParseResultSchema: GenMessage<CodecMultikeyParseResult>;
178
+ /**
179
+ * CodecDagCborVerifyCidResult contains the deterministic CID verification
180
+ * result without requiring callers to parse fixed-shape JSON.
181
+ *
182
+ * @generated from message reallyme.codec.v1.CodecDagCborVerifyCidResult
183
+ */
184
+ export type CodecDagCborVerifyCidResult = Message<"reallyme.codec.v1.CodecDagCborVerifyCidResult"> & {
185
+ /**
186
+ * @generated from field: bool valid = 1;
187
+ */
188
+ valid: boolean;
189
+ /**
190
+ * @generated from field: string expected_cid = 2;
191
+ */
192
+ expectedCid: string;
193
+ /**
194
+ * @generated from field: string actual_cid = 3;
195
+ */
196
+ actualCid: string;
197
+ };
198
+ /**
199
+ * Describes the message reallyme.codec.v1.CodecDagCborVerifyCidResult.
200
+ * Use `create(CodecDagCborVerifyCidResultSchema)` to create a new message.
201
+ */
202
+ export declare const CodecDagCborVerifyCidResultSchema: GenMessage<CodecDagCborVerifyCidResult>;
203
+ /**
204
+ * CodecPemDecodeResult is the binary/protobuf form of PEM armor decoding.
205
+ *
206
+ * @generated from message reallyme.codec.v1.CodecPemDecodeResult
207
+ */
208
+ export type CodecPemDecodeResult = Message<"reallyme.codec.v1.CodecPemDecodeResult"> & {
209
+ /**
210
+ * @generated from field: string label = 1;
211
+ */
212
+ label: string;
213
+ /**
214
+ * DER may contain private-key material. Receivers that request protobuf PEM
215
+ * decode results are responsible for copying it into their language's
216
+ * sensitive-buffer owner and wiping intermediate protobuf containers as soon
217
+ * as practical.
218
+ *
219
+ * @generated from field: bytes der = 2;
220
+ */
221
+ der: Uint8Array;
222
+ };
223
+ /**
224
+ * Describes the message reallyme.codec.v1.CodecPemDecodeResult.
225
+ * Use `create(CodecPemDecodeResultSchema)` to create a new message.
226
+ */
227
+ export declare const CodecPemDecodeResultSchema: GenMessage<CodecPemDecodeResult>;
228
+ /**
229
+ * CodecBaseEncodingError describes base64, base64url, hex, and generic byte
230
+ * encoding failures.
231
+ *
232
+ * @generated from message reallyme.codec.v1.CodecBaseEncodingError
233
+ */
234
+ export type CodecBaseEncodingError = Message<"reallyme.codec.v1.CodecBaseEncodingError"> & {
235
+ /**
236
+ * Reason must be one of the CODEC_ERROR_REASON_BASE_* values.
237
+ *
238
+ * @generated from field: reallyme.codec.v1.CodecErrorReason reason = 1;
239
+ */
240
+ reason: CodecErrorReason;
241
+ };
242
+ /**
243
+ * Describes the message reallyme.codec.v1.CodecBaseEncodingError.
244
+ * Use `create(CodecBaseEncodingErrorSchema)` to create a new message.
245
+ */
246
+ export declare const CodecBaseEncodingErrorSchema: GenMessage<CodecBaseEncodingError>;
247
+ /**
248
+ * CodecPemError describes RFC 7468-style PEM armor boundary and body failures.
249
+ *
250
+ * @generated from message reallyme.codec.v1.CodecPemError
251
+ */
252
+ export type CodecPemError = Message<"reallyme.codec.v1.CodecPemError"> & {
253
+ /**
254
+ * Reason must be one of the CODEC_ERROR_REASON_PEM_* values.
255
+ *
256
+ * @generated from field: reallyme.codec.v1.CodecErrorReason reason = 1;
257
+ */
258
+ reason: CodecErrorReason;
259
+ };
260
+ /**
261
+ * Describes the message reallyme.codec.v1.CodecPemError.
262
+ * Use `create(CodecPemErrorSchema)` to create a new message.
263
+ */
264
+ export declare const CodecPemErrorSchema: GenMessage<CodecPemError>;
265
+ /**
266
+ * CodecMultiformatError describes multibase, multicodec, and multikey
267
+ * envelope failures.
268
+ *
269
+ * @generated from message reallyme.codec.v1.CodecMultiformatError
270
+ */
271
+ export type CodecMultiformatError = Message<"reallyme.codec.v1.CodecMultiformatError"> & {
272
+ /**
273
+ * Reason must be one of the CODEC_ERROR_REASON_MULTIFORMAT_* values.
274
+ *
275
+ * @generated from field: reallyme.codec.v1.CodecErrorReason reason = 1;
276
+ */
277
+ reason: CodecErrorReason;
278
+ };
279
+ /**
280
+ * Describes the message reallyme.codec.v1.CodecMultiformatError.
281
+ * Use `create(CodecMultiformatErrorSchema)` to create a new message.
282
+ */
283
+ export declare const CodecMultiformatErrorSchema: GenMessage<CodecMultiformatError>;
284
+ /**
285
+ * CodecCanonicalizationError describes CBOR, DAG-CBOR, JCS, and JSON
286
+ * canonicalization failures.
287
+ *
288
+ * @generated from message reallyme.codec.v1.CodecCanonicalizationError
289
+ */
290
+ export type CodecCanonicalizationError = Message<"reallyme.codec.v1.CodecCanonicalizationError"> & {
291
+ /**
292
+ * Reason must be one of the CODEC_ERROR_REASON_CANONICAL_* values.
293
+ *
294
+ * @generated from field: reallyme.codec.v1.CodecErrorReason reason = 1;
295
+ */
296
+ reason: CodecErrorReason;
297
+ };
298
+ /**
299
+ * Describes the message reallyme.codec.v1.CodecCanonicalizationError.
300
+ * Use `create(CodecCanonicalizationErrorSchema)` to create a new message.
301
+ */
302
+ export declare const CodecCanonicalizationErrorSchema: GenMessage<CodecCanonicalizationError>;
303
+ /**
304
+ * CodecKeyMaterialKind classifies the material described by a multicodec
305
+ * table entry. The enum is intentionally small and owned by this package so
306
+ * SDKs do not pass ad hoc strings across FFI or RPC boundaries.
307
+ *
308
+ * @generated from enum reallyme.codec.v1.CodecKeyMaterialKind
309
+ */
310
+ export declare enum CodecKeyMaterialKind {
311
+ /**
312
+ * @generated from enum value: CODEC_KEY_MATERIAL_KIND_UNSPECIFIED = 0;
313
+ */
314
+ UNSPECIFIED = 0,
315
+ /**
316
+ * @generated from enum value: CODEC_KEY_MATERIAL_KIND_PUBLIC_KEY = 1;
317
+ */
318
+ PUBLIC_KEY = 1,
319
+ /**
320
+ * @generated from enum value: CODEC_KEY_MATERIAL_KIND_PRIVATE_KEY = 2;
321
+ */
322
+ PRIVATE_KEY = 2,
323
+ /**
324
+ * @generated from enum value: CODEC_KEY_MATERIAL_KIND_SYMMETRIC_KEY = 3;
325
+ */
326
+ SYMMETRIC_KEY = 3,
327
+ /**
328
+ * @generated from enum value: CODEC_KEY_MATERIAL_KIND_NOT_KEY = 4;
329
+ */
330
+ NOT_KEY = 4
331
+ }
332
+ /**
333
+ * Describes the enum reallyme.codec.v1.CodecKeyMaterialKind.
334
+ */
335
+ export declare const CodecKeyMaterialKindSchema: GenEnum<CodecKeyMaterialKind>;
336
+ /**
337
+ * CodecTag classifies the protocol role of a multicodec table entry.
338
+ *
339
+ * @generated from enum reallyme.codec.v1.CodecTag
340
+ */
341
+ export declare enum CodecTag {
342
+ /**
343
+ * @generated from enum value: CODEC_TAG_UNSPECIFIED = 0;
344
+ */
345
+ UNSPECIFIED = 0,
346
+ /**
347
+ * @generated from enum value: CODEC_TAG_ENCRYPTION = 1;
348
+ */
349
+ ENCRYPTION = 1,
350
+ /**
351
+ * @generated from enum value: CODEC_TAG_KEY = 2;
352
+ */
353
+ KEY = 2,
354
+ /**
355
+ * @generated from enum value: CODEC_TAG_HASH = 3;
356
+ */
357
+ HASH = 3,
358
+ /**
359
+ * @generated from enum value: CODEC_TAG_MULTIHASH = 4;
360
+ */
361
+ MULTIHASH = 4,
362
+ /**
363
+ * @generated from enum value: CODEC_TAG_MULTIKEY = 5;
364
+ */
365
+ MULTIKEY = 5
366
+ }
367
+ /**
368
+ * Describes the enum reallyme.codec.v1.CodecTag.
369
+ */
370
+ export declare const CodecTagSchema: GenEnum<CodecTag>;
371
+ /**
372
+ * CodecErrorReason is the component-owned reason-code enum for reallyme/codec.
373
+ * Values are stable public boundary codes; local parser errors must map into
374
+ * one of these before crossing RPC, SDK, FFI, storage, audit, or telemetry
375
+ * boundaries. Numeric ranges are intentionally split by codec subpart:
376
+ * 100-199: base encodings
377
+ * 200-299: PEM armor
378
+ * 300-399: multiformats and key envelopes
379
+ * 400-499: CBOR/JCS/JSON canonicalization
380
+ *
381
+ * @generated from enum reallyme.codec.v1.CodecErrorReason
382
+ */
383
+ export declare enum CodecErrorReason {
384
+ /**
385
+ * @generated from enum value: CODEC_ERROR_REASON_UNSPECIFIED = 0;
386
+ */
387
+ UNSPECIFIED = 0,
388
+ /**
389
+ * Base encodings and generic byte-envelope limits.
390
+ *
391
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_UNSUPPORTED_CODEC = 100;
392
+ */
393
+ BASE_UNSUPPORTED_CODEC = 100,
394
+ /**
395
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_INVALID_ENCODING = 101;
396
+ */
397
+ BASE_INVALID_ENCODING = 101,
398
+ /**
399
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_INVALID_LENGTH = 102;
400
+ */
401
+ BASE_INVALID_LENGTH = 102,
402
+ /**
403
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_INPUT_TOO_LARGE = 103;
404
+ */
405
+ BASE_INPUT_TOO_LARGE = 103,
406
+ /**
407
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_OUTPUT_TOO_LARGE = 104;
408
+ */
409
+ BASE_OUTPUT_TOO_LARGE = 104,
410
+ /**
411
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_INVALID_BASE64 = 110;
412
+ */
413
+ BASE_INVALID_BASE64 = 110,
414
+ /**
415
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_INVALID_BASE64URL = 111;
416
+ */
417
+ BASE_INVALID_BASE64URL = 111,
418
+ /**
419
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_INVALID_HEX = 120;
420
+ */
421
+ BASE_INVALID_HEX = 120,
422
+ /**
423
+ * @generated from enum value: CODEC_ERROR_REASON_BASE_NON_CANONICAL_HEX = 121;
424
+ */
425
+ BASE_NON_CANONICAL_HEX = 121,
426
+ /**
427
+ * PEM armor.
428
+ *
429
+ * @generated from enum value: CODEC_ERROR_REASON_PEM_INVALID_BOUNDARY = 200;
430
+ */
431
+ PEM_INVALID_BOUNDARY = 200,
432
+ /**
433
+ * @generated from enum value: CODEC_ERROR_REASON_PEM_LABEL_MISMATCH = 201;
434
+ */
435
+ PEM_LABEL_MISMATCH = 201,
436
+ /**
437
+ * @generated from enum value: CODEC_ERROR_REASON_PEM_UNSUPPORTED_LABEL = 202;
438
+ */
439
+ PEM_UNSUPPORTED_LABEL = 202,
440
+ /**
441
+ * @generated from enum value: CODEC_ERROR_REASON_PEM_INVALID_BODY = 203;
442
+ */
443
+ PEM_INVALID_BODY = 203,
444
+ /**
445
+ * @generated from enum value: CODEC_ERROR_REASON_PEM_DER_TOO_LARGE = 204;
446
+ */
447
+ PEM_DER_TOO_LARGE = 204,
448
+ /**
449
+ * Multiformats and key envelopes.
450
+ *
451
+ * @generated from enum value: CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIBASE_PREFIX = 300;
452
+ */
453
+ MULTIFORMAT_INVALID_MULTIBASE_PREFIX = 300,
454
+ /**
455
+ * @generated from enum value: CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTICODEC_PREFIX = 301;
456
+ */
457
+ MULTIFORMAT_INVALID_MULTICODEC_PREFIX = 301,
458
+ /**
459
+ * @generated from enum value: CODEC_ERROR_REASON_MULTIFORMAT_UNKNOWN_MULTICODEC = 302;
460
+ */
461
+ MULTIFORMAT_UNKNOWN_MULTICODEC = 302,
462
+ /**
463
+ * @generated from enum value: CODEC_ERROR_REASON_MULTIFORMAT_INVALID_MULTIKEY = 303;
464
+ */
465
+ MULTIFORMAT_INVALID_MULTIKEY = 303,
466
+ /**
467
+ * CBOR, DAG-CBOR, JCS, and JSON canonicalization.
468
+ *
469
+ * @generated from enum value: CODEC_ERROR_REASON_CANONICAL_INVALID_CBOR = 400;
470
+ */
471
+ CANONICAL_INVALID_CBOR = 400,
472
+ /**
473
+ * @generated from enum value: CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_CBOR = 401;
474
+ */
475
+ CANONICAL_NON_CANONICAL_CBOR = 401,
476
+ /**
477
+ * @generated from enum value: CODEC_ERROR_REASON_CANONICAL_INVALID_JSON = 402;
478
+ */
479
+ CANONICAL_INVALID_JSON = 402,
480
+ /**
481
+ * @generated from enum value: CODEC_ERROR_REASON_CANONICAL_NON_CANONICAL_JSON = 403;
482
+ */
483
+ CANONICAL_NON_CANONICAL_JSON = 403,
484
+ /**
485
+ * @generated from enum value: CODEC_ERROR_REASON_CANONICAL_INTERNAL = 404;
486
+ */
487
+ CANONICAL_INTERNAL = 404
488
+ }
489
+ /**
490
+ * Describes the enum reallyme.codec.v1.CodecErrorReason.
491
+ */
492
+ export declare const CodecErrorReasonSchema: GenEnum<CodecErrorReason>;