@mindburn/helm-ai-kernel 0.5.10 → 0.5.11
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.
- package/README.md +2 -2
- package/dist/generated/boundary/extauthz/v1/extauthz.d.ts +171 -0
- package/dist/generated/boundary/extauthz/v1/extauthz.js +1901 -0
- package/dist/generated/google/protobuf/struct.d.ts +107 -0
- package/dist/generated/google/protobuf/struct.js +475 -0
- package/dist/types.gen.d.ts +173 -173
- package/package.json +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
5
|
+
* `Value` type union.
|
|
6
|
+
*
|
|
7
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum NullValue {
|
|
10
|
+
/** NULL_VALUE - Null value. */
|
|
11
|
+
NULL_VALUE = 0,
|
|
12
|
+
UNRECOGNIZED = -1
|
|
13
|
+
}
|
|
14
|
+
export declare function nullValueFromJSON(object: any): NullValue;
|
|
15
|
+
export declare function nullValueToJSON(object: NullValue): string;
|
|
16
|
+
/**
|
|
17
|
+
* `Struct` represents a structured data value, consisting of fields
|
|
18
|
+
* which map to dynamically typed values. In some languages, `Struct`
|
|
19
|
+
* might be supported by a native representation. For example, in
|
|
20
|
+
* scripting languages like JS a struct is represented as an
|
|
21
|
+
* object. The details of that representation are described together
|
|
22
|
+
* with the proto support for the language.
|
|
23
|
+
*
|
|
24
|
+
* The JSON representation for `Struct` is JSON object.
|
|
25
|
+
*/
|
|
26
|
+
export interface Struct {
|
|
27
|
+
/** Unordered map of dynamically typed values. */
|
|
28
|
+
fields: {
|
|
29
|
+
[key: string]: any | undefined;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface Struct_FieldsEntry {
|
|
33
|
+
key: string;
|
|
34
|
+
value: any | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `Value` represents a dynamically typed value which can be either
|
|
38
|
+
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
39
|
+
* list of values. A producer of value is expected to set one of these
|
|
40
|
+
* variants. Absence of any variant indicates an error.
|
|
41
|
+
*
|
|
42
|
+
* The JSON representation for `Value` is JSON value.
|
|
43
|
+
*/
|
|
44
|
+
export interface Value {
|
|
45
|
+
/** Represents a null value. */
|
|
46
|
+
nullValue?: NullValue | undefined;
|
|
47
|
+
/** Represents a double value. */
|
|
48
|
+
numberValue?: number | undefined;
|
|
49
|
+
/** Represents a string value. */
|
|
50
|
+
stringValue?: string | undefined;
|
|
51
|
+
/** Represents a boolean value. */
|
|
52
|
+
boolValue?: boolean | undefined;
|
|
53
|
+
/** Represents a structured value. */
|
|
54
|
+
structValue?: {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
} | undefined;
|
|
57
|
+
/** Represents a repeated `Value`. */
|
|
58
|
+
listValue?: Array<any> | undefined;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* `ListValue` is a wrapper around a repeated field of values.
|
|
62
|
+
*
|
|
63
|
+
* The JSON representation for `ListValue` is JSON array.
|
|
64
|
+
*/
|
|
65
|
+
export interface ListValue {
|
|
66
|
+
/** Repeated field of dynamically typed values. */
|
|
67
|
+
values: any[];
|
|
68
|
+
}
|
|
69
|
+
export declare const Struct: MessageFns<Struct> & StructWrapperFns;
|
|
70
|
+
export declare const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry>;
|
|
71
|
+
export declare const Value: MessageFns<Value> & AnyValueWrapperFns;
|
|
72
|
+
export declare const ListValue: MessageFns<ListValue> & ListValueWrapperFns;
|
|
73
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
74
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
75
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
76
|
+
} : Partial<T>;
|
|
77
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
78
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
79
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
80
|
+
} & {
|
|
81
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
82
|
+
};
|
|
83
|
+
export interface MessageFns<T> {
|
|
84
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
85
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
86
|
+
fromJSON(object: any): T;
|
|
87
|
+
toJSON(message: T): unknown;
|
|
88
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
89
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
90
|
+
}
|
|
91
|
+
export interface StructWrapperFns {
|
|
92
|
+
wrap(object: {
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
} | undefined): Struct;
|
|
95
|
+
unwrap(message: Struct): {
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface AnyValueWrapperFns {
|
|
100
|
+
wrap(value: any): Value;
|
|
101
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
|
|
102
|
+
}
|
|
103
|
+
export interface ListValueWrapperFns {
|
|
104
|
+
wrap(array: Array<any> | undefined): ListValue;
|
|
105
|
+
unwrap(message: ListValue): Array<any>;
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,475 @@
|
|
|
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: google/protobuf/struct.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
export const protobufPackage = "google.protobuf";
|
|
9
|
+
/**
|
|
10
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
11
|
+
* `Value` type union.
|
|
12
|
+
*
|
|
13
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
14
|
+
*/
|
|
15
|
+
export var NullValue;
|
|
16
|
+
(function (NullValue) {
|
|
17
|
+
/** NULL_VALUE - Null value. */
|
|
18
|
+
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
19
|
+
NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
20
|
+
})(NullValue || (NullValue = {}));
|
|
21
|
+
export function nullValueFromJSON(object) {
|
|
22
|
+
switch (object) {
|
|
23
|
+
case 0:
|
|
24
|
+
case "NULL_VALUE":
|
|
25
|
+
return NullValue.NULL_VALUE;
|
|
26
|
+
case -1:
|
|
27
|
+
case "UNRECOGNIZED":
|
|
28
|
+
default:
|
|
29
|
+
return NullValue.UNRECOGNIZED;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function nullValueToJSON(object) {
|
|
33
|
+
switch (object) {
|
|
34
|
+
case NullValue.NULL_VALUE:
|
|
35
|
+
return "NULL_VALUE";
|
|
36
|
+
case NullValue.UNRECOGNIZED:
|
|
37
|
+
default:
|
|
38
|
+
return "UNRECOGNIZED";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function createBaseStruct() {
|
|
42
|
+
return { fields: {} };
|
|
43
|
+
}
|
|
44
|
+
export const Struct = {
|
|
45
|
+
encode(message, writer = new BinaryWriter()) {
|
|
46
|
+
globalThis.Object.entries(message.fields).forEach(([key, value]) => {
|
|
47
|
+
if (value !== undefined) {
|
|
48
|
+
Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).join();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return writer;
|
|
52
|
+
},
|
|
53
|
+
decode(input, length) {
|
|
54
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
55
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
56
|
+
const message = createBaseStruct();
|
|
57
|
+
while (reader.pos < end) {
|
|
58
|
+
const tag = reader.uint32();
|
|
59
|
+
switch (tag >>> 3) {
|
|
60
|
+
case 1: {
|
|
61
|
+
if (tag !== 10) {
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
65
|
+
if (entry1.value !== undefined) {
|
|
66
|
+
message.fields[entry1.key] = entry1.value;
|
|
67
|
+
}
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
reader.skip(tag & 7);
|
|
75
|
+
}
|
|
76
|
+
return message;
|
|
77
|
+
},
|
|
78
|
+
fromJSON(object) {
|
|
79
|
+
return {
|
|
80
|
+
fields: isObject(object.fields)
|
|
81
|
+
? globalThis.Object.entries(object.fields).reduce((acc, [key, value]) => {
|
|
82
|
+
acc[key] = value;
|
|
83
|
+
return acc;
|
|
84
|
+
}, {})
|
|
85
|
+
: {},
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
toJSON(message) {
|
|
89
|
+
const obj = {};
|
|
90
|
+
if (message.fields) {
|
|
91
|
+
const entries = globalThis.Object.entries(message.fields);
|
|
92
|
+
if (entries.length > 0) {
|
|
93
|
+
obj.fields = {};
|
|
94
|
+
entries.forEach(([k, v]) => {
|
|
95
|
+
obj.fields[k] = v;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return obj;
|
|
100
|
+
},
|
|
101
|
+
create(base) {
|
|
102
|
+
return Struct.fromPartial(base ?? {});
|
|
103
|
+
},
|
|
104
|
+
fromPartial(object) {
|
|
105
|
+
const message = createBaseStruct();
|
|
106
|
+
message.fields = globalThis.Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
|
|
107
|
+
if (value !== undefined) {
|
|
108
|
+
acc[key] = value;
|
|
109
|
+
}
|
|
110
|
+
return acc;
|
|
111
|
+
}, {});
|
|
112
|
+
return message;
|
|
113
|
+
},
|
|
114
|
+
wrap(object) {
|
|
115
|
+
const struct = createBaseStruct();
|
|
116
|
+
if (object !== undefined) {
|
|
117
|
+
for (const key of globalThis.Object.keys(object)) {
|
|
118
|
+
struct.fields[key] = object[key];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return struct;
|
|
122
|
+
},
|
|
123
|
+
unwrap(message) {
|
|
124
|
+
const object = {};
|
|
125
|
+
if (message.fields) {
|
|
126
|
+
for (const key of globalThis.Object.keys(message.fields)) {
|
|
127
|
+
object[key] = message.fields[key];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return object;
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
function createBaseStruct_FieldsEntry() {
|
|
134
|
+
return { key: "", value: undefined };
|
|
135
|
+
}
|
|
136
|
+
export const Struct_FieldsEntry = {
|
|
137
|
+
encode(message, writer = new BinaryWriter()) {
|
|
138
|
+
if (message.key !== "") {
|
|
139
|
+
writer.uint32(10).string(message.key);
|
|
140
|
+
}
|
|
141
|
+
if (message.value !== undefined) {
|
|
142
|
+
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
|
|
143
|
+
}
|
|
144
|
+
return writer;
|
|
145
|
+
},
|
|
146
|
+
decode(input, length) {
|
|
147
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
148
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
149
|
+
const message = createBaseStruct_FieldsEntry();
|
|
150
|
+
while (reader.pos < end) {
|
|
151
|
+
const tag = reader.uint32();
|
|
152
|
+
switch (tag >>> 3) {
|
|
153
|
+
case 1: {
|
|
154
|
+
if (tag !== 10) {
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
message.key = reader.string();
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
case 2: {
|
|
161
|
+
if (tag !== 18) {
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
reader.skip(tag & 7);
|
|
172
|
+
}
|
|
173
|
+
return message;
|
|
174
|
+
},
|
|
175
|
+
fromJSON(object) {
|
|
176
|
+
return {
|
|
177
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
178
|
+
value: isSet(object?.value) ? object.value : undefined,
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
toJSON(message) {
|
|
182
|
+
const obj = {};
|
|
183
|
+
if (message.key !== "") {
|
|
184
|
+
obj.key = message.key;
|
|
185
|
+
}
|
|
186
|
+
if (message.value !== undefined) {
|
|
187
|
+
obj.value = message.value;
|
|
188
|
+
}
|
|
189
|
+
return obj;
|
|
190
|
+
},
|
|
191
|
+
create(base) {
|
|
192
|
+
return Struct_FieldsEntry.fromPartial(base ?? {});
|
|
193
|
+
},
|
|
194
|
+
fromPartial(object) {
|
|
195
|
+
const message = createBaseStruct_FieldsEntry();
|
|
196
|
+
message.key = object.key ?? "";
|
|
197
|
+
message.value = object.value ?? undefined;
|
|
198
|
+
return message;
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
function createBaseValue() {
|
|
202
|
+
return {
|
|
203
|
+
nullValue: undefined,
|
|
204
|
+
numberValue: undefined,
|
|
205
|
+
stringValue: undefined,
|
|
206
|
+
boolValue: undefined,
|
|
207
|
+
structValue: undefined,
|
|
208
|
+
listValue: undefined,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
export const Value = {
|
|
212
|
+
encode(message, writer = new BinaryWriter()) {
|
|
213
|
+
if (message.nullValue !== undefined) {
|
|
214
|
+
writer.uint32(8).int32(message.nullValue);
|
|
215
|
+
}
|
|
216
|
+
if (message.numberValue !== undefined) {
|
|
217
|
+
writer.uint32(17).double(message.numberValue);
|
|
218
|
+
}
|
|
219
|
+
if (message.stringValue !== undefined) {
|
|
220
|
+
writer.uint32(26).string(message.stringValue);
|
|
221
|
+
}
|
|
222
|
+
if (message.boolValue !== undefined) {
|
|
223
|
+
writer.uint32(32).bool(message.boolValue);
|
|
224
|
+
}
|
|
225
|
+
if (message.structValue !== undefined) {
|
|
226
|
+
Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
|
|
227
|
+
}
|
|
228
|
+
if (message.listValue !== undefined) {
|
|
229
|
+
ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
|
|
230
|
+
}
|
|
231
|
+
return writer;
|
|
232
|
+
},
|
|
233
|
+
decode(input, length) {
|
|
234
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
235
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
236
|
+
const message = createBaseValue();
|
|
237
|
+
while (reader.pos < end) {
|
|
238
|
+
const tag = reader.uint32();
|
|
239
|
+
switch (tag >>> 3) {
|
|
240
|
+
case 1: {
|
|
241
|
+
if (tag !== 8) {
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
message.nullValue = reader.int32();
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
case 2: {
|
|
248
|
+
if (tag !== 17) {
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
message.numberValue = reader.double();
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
case 3: {
|
|
255
|
+
if (tag !== 26) {
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
message.stringValue = reader.string();
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
case 4: {
|
|
262
|
+
if (tag !== 32) {
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
message.boolValue = reader.bool();
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
case 5: {
|
|
269
|
+
if (tag !== 42) {
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
case 6: {
|
|
276
|
+
if (tag !== 50) {
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
reader.skip(tag & 7);
|
|
287
|
+
}
|
|
288
|
+
return message;
|
|
289
|
+
},
|
|
290
|
+
fromJSON(object) {
|
|
291
|
+
return {
|
|
292
|
+
nullValue: isSet(object.nullValue)
|
|
293
|
+
? nullValueFromJSON(object.nullValue)
|
|
294
|
+
: isSet(object.null_value)
|
|
295
|
+
? nullValueFromJSON(object.null_value)
|
|
296
|
+
: undefined,
|
|
297
|
+
numberValue: isSet(object.numberValue)
|
|
298
|
+
? globalThis.Number(object.numberValue)
|
|
299
|
+
: isSet(object.number_value)
|
|
300
|
+
? globalThis.Number(object.number_value)
|
|
301
|
+
: undefined,
|
|
302
|
+
stringValue: isSet(object.stringValue)
|
|
303
|
+
? globalThis.String(object.stringValue)
|
|
304
|
+
: isSet(object.string_value)
|
|
305
|
+
? globalThis.String(object.string_value)
|
|
306
|
+
: undefined,
|
|
307
|
+
boolValue: isSet(object.boolValue)
|
|
308
|
+
? globalThis.Boolean(object.boolValue)
|
|
309
|
+
: isSet(object.bool_value)
|
|
310
|
+
? globalThis.Boolean(object.bool_value)
|
|
311
|
+
: undefined,
|
|
312
|
+
structValue: isObject(object.structValue)
|
|
313
|
+
? object.structValue
|
|
314
|
+
: isObject(object.struct_value)
|
|
315
|
+
? object.struct_value
|
|
316
|
+
: undefined,
|
|
317
|
+
listValue: globalThis.Array.isArray(object.listValue)
|
|
318
|
+
? [...object.listValue]
|
|
319
|
+
: globalThis.Array.isArray(object.list_value)
|
|
320
|
+
? [...object.list_value]
|
|
321
|
+
: undefined,
|
|
322
|
+
};
|
|
323
|
+
},
|
|
324
|
+
toJSON(message) {
|
|
325
|
+
const obj = {};
|
|
326
|
+
if (message.nullValue !== undefined) {
|
|
327
|
+
obj.nullValue = nullValueToJSON(message.nullValue);
|
|
328
|
+
}
|
|
329
|
+
if (message.numberValue !== undefined) {
|
|
330
|
+
obj.numberValue = message.numberValue;
|
|
331
|
+
}
|
|
332
|
+
if (message.stringValue !== undefined) {
|
|
333
|
+
obj.stringValue = message.stringValue;
|
|
334
|
+
}
|
|
335
|
+
if (message.boolValue !== undefined) {
|
|
336
|
+
obj.boolValue = message.boolValue;
|
|
337
|
+
}
|
|
338
|
+
if (message.structValue !== undefined) {
|
|
339
|
+
obj.structValue = message.structValue;
|
|
340
|
+
}
|
|
341
|
+
if (message.listValue !== undefined) {
|
|
342
|
+
obj.listValue = message.listValue;
|
|
343
|
+
}
|
|
344
|
+
return obj;
|
|
345
|
+
},
|
|
346
|
+
create(base) {
|
|
347
|
+
return Value.fromPartial(base ?? {});
|
|
348
|
+
},
|
|
349
|
+
fromPartial(object) {
|
|
350
|
+
const message = createBaseValue();
|
|
351
|
+
message.nullValue = object.nullValue ?? undefined;
|
|
352
|
+
message.numberValue = object.numberValue ?? undefined;
|
|
353
|
+
message.stringValue = object.stringValue ?? undefined;
|
|
354
|
+
message.boolValue = object.boolValue ?? undefined;
|
|
355
|
+
message.structValue = object.structValue ?? undefined;
|
|
356
|
+
message.listValue = object.listValue ?? undefined;
|
|
357
|
+
return message;
|
|
358
|
+
},
|
|
359
|
+
wrap(value) {
|
|
360
|
+
const result = createBaseValue();
|
|
361
|
+
if (value === null) {
|
|
362
|
+
result.nullValue = NullValue.NULL_VALUE;
|
|
363
|
+
}
|
|
364
|
+
else if (typeof value === "boolean") {
|
|
365
|
+
result.boolValue = value;
|
|
366
|
+
}
|
|
367
|
+
else if (typeof value === "number") {
|
|
368
|
+
result.numberValue = value;
|
|
369
|
+
}
|
|
370
|
+
else if (typeof value === "string") {
|
|
371
|
+
result.stringValue = value;
|
|
372
|
+
}
|
|
373
|
+
else if (globalThis.Array.isArray(value)) {
|
|
374
|
+
result.listValue = value;
|
|
375
|
+
}
|
|
376
|
+
else if (typeof value === "object") {
|
|
377
|
+
result.structValue = value;
|
|
378
|
+
}
|
|
379
|
+
else if (typeof value !== "undefined") {
|
|
380
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
381
|
+
}
|
|
382
|
+
return result;
|
|
383
|
+
},
|
|
384
|
+
unwrap(message) {
|
|
385
|
+
if (message.stringValue !== undefined) {
|
|
386
|
+
return message.stringValue;
|
|
387
|
+
}
|
|
388
|
+
else if (message?.numberValue !== undefined) {
|
|
389
|
+
return message.numberValue;
|
|
390
|
+
}
|
|
391
|
+
else if (message?.boolValue !== undefined) {
|
|
392
|
+
return message.boolValue;
|
|
393
|
+
}
|
|
394
|
+
else if (message?.structValue !== undefined) {
|
|
395
|
+
return message.structValue;
|
|
396
|
+
}
|
|
397
|
+
else if (message?.listValue !== undefined) {
|
|
398
|
+
return message.listValue;
|
|
399
|
+
}
|
|
400
|
+
else if (message?.nullValue !== undefined) {
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
return undefined;
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
function createBaseListValue() {
|
|
407
|
+
return { values: [] };
|
|
408
|
+
}
|
|
409
|
+
export const ListValue = {
|
|
410
|
+
encode(message, writer = new BinaryWriter()) {
|
|
411
|
+
for (const v of message.values) {
|
|
412
|
+
Value.encode(Value.wrap(v), writer.uint32(10).fork()).join();
|
|
413
|
+
}
|
|
414
|
+
return writer;
|
|
415
|
+
},
|
|
416
|
+
decode(input, length) {
|
|
417
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
418
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
419
|
+
const message = createBaseListValue();
|
|
420
|
+
while (reader.pos < end) {
|
|
421
|
+
const tag = reader.uint32();
|
|
422
|
+
switch (tag >>> 3) {
|
|
423
|
+
case 1: {
|
|
424
|
+
if (tag !== 10) {
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
reader.skip(tag & 7);
|
|
435
|
+
}
|
|
436
|
+
return message;
|
|
437
|
+
},
|
|
438
|
+
fromJSON(object) {
|
|
439
|
+
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
440
|
+
},
|
|
441
|
+
toJSON(message) {
|
|
442
|
+
const obj = {};
|
|
443
|
+
if (message.values?.length) {
|
|
444
|
+
obj.values = message.values;
|
|
445
|
+
}
|
|
446
|
+
return obj;
|
|
447
|
+
},
|
|
448
|
+
create(base) {
|
|
449
|
+
return ListValue.fromPartial(base ?? {});
|
|
450
|
+
},
|
|
451
|
+
fromPartial(object) {
|
|
452
|
+
const message = createBaseListValue();
|
|
453
|
+
message.values = object.values?.map((e) => e) || [];
|
|
454
|
+
return message;
|
|
455
|
+
},
|
|
456
|
+
wrap(array) {
|
|
457
|
+
const result = createBaseListValue();
|
|
458
|
+
result.values = array ?? [];
|
|
459
|
+
return result;
|
|
460
|
+
},
|
|
461
|
+
unwrap(message) {
|
|
462
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
463
|
+
return message.values;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
return message;
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
};
|
|
470
|
+
function isObject(value) {
|
|
471
|
+
return typeof value === "object" && value !== null;
|
|
472
|
+
}
|
|
473
|
+
function isSet(value) {
|
|
474
|
+
return value !== null && value !== undefined;
|
|
475
|
+
}
|