@stashfin/grpc 1.5.32 → 1.5.33
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/package.json
CHANGED
|
@@ -24,6 +24,10 @@ export interface TxnResponse {
|
|
|
24
24
|
paid_at: string;
|
|
25
25
|
/** optional / nullable */
|
|
26
26
|
biller_status?: string | undefined;
|
|
27
|
+
/** JSON metadata */
|
|
28
|
+
metadata?: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
} | undefined;
|
|
27
31
|
}
|
|
28
32
|
export interface AuthSessionResponse {
|
|
29
33
|
customer_id: number;
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.BDTransactionResponse = exports.AuthSessionResponse = exports.TxnResponse = exports.BDTransactionRequest = exports.protobufPackage = void 0;
|
|
12
12
|
/* eslint-disable */
|
|
13
13
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
14
|
+
const struct_1 = require("../google/protobuf/struct");
|
|
14
15
|
exports.protobufPackage = "bbps.processwebhook";
|
|
15
16
|
function createBaseBDTransactionRequest() {
|
|
16
17
|
return { metadata: "" };
|
|
@@ -78,6 +79,7 @@ function createBaseTxnResponse() {
|
|
|
78
79
|
source_ref_no: undefined,
|
|
79
80
|
paid_at: "",
|
|
80
81
|
biller_status: undefined,
|
|
82
|
+
metadata: undefined,
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
exports.TxnResponse = {
|
|
@@ -124,6 +126,9 @@ exports.TxnResponse = {
|
|
|
124
126
|
if (message.biller_status !== undefined) {
|
|
125
127
|
writer.uint32(114).string(message.biller_status);
|
|
126
128
|
}
|
|
129
|
+
if (message.metadata !== undefined) {
|
|
130
|
+
struct_1.Struct.encode(struct_1.Struct.wrap(message.metadata), writer.uint32(122).fork()).ldelim();
|
|
131
|
+
}
|
|
127
132
|
return writer;
|
|
128
133
|
},
|
|
129
134
|
decode(input, length) {
|
|
@@ -217,6 +222,12 @@ exports.TxnResponse = {
|
|
|
217
222
|
}
|
|
218
223
|
message.biller_status = reader.string();
|
|
219
224
|
continue;
|
|
225
|
+
case 15:
|
|
226
|
+
if (tag !== 122) {
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
message.metadata = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
|
|
230
|
+
continue;
|
|
220
231
|
}
|
|
221
232
|
if ((tag & 7) === 4 || tag === 0) {
|
|
222
233
|
break;
|
|
@@ -241,6 +252,7 @@ exports.TxnResponse = {
|
|
|
241
252
|
source_ref_no: isSet(object.source_ref_no) ? globalThis.String(object.source_ref_no) : undefined,
|
|
242
253
|
paid_at: isSet(object.paid_at) ? globalThis.String(object.paid_at) : "",
|
|
243
254
|
biller_status: isSet(object.biller_status) ? globalThis.String(object.biller_status) : undefined,
|
|
255
|
+
metadata: isObject(object.metadata) ? object.metadata : undefined,
|
|
244
256
|
};
|
|
245
257
|
},
|
|
246
258
|
toJSON(message) {
|
|
@@ -287,6 +299,9 @@ exports.TxnResponse = {
|
|
|
287
299
|
if (message.biller_status !== undefined) {
|
|
288
300
|
obj.biller_status = message.biller_status;
|
|
289
301
|
}
|
|
302
|
+
if (message.metadata !== undefined) {
|
|
303
|
+
obj.metadata = message.metadata;
|
|
304
|
+
}
|
|
290
305
|
return obj;
|
|
291
306
|
},
|
|
292
307
|
create(base) {
|
|
@@ -308,6 +323,7 @@ exports.TxnResponse = {
|
|
|
308
323
|
message.source_ref_no = object.source_ref_no ?? undefined;
|
|
309
324
|
message.paid_at = object.paid_at ?? "";
|
|
310
325
|
message.biller_status = object.biller_status ?? undefined;
|
|
326
|
+
message.metadata = object.metadata ?? undefined;
|
|
311
327
|
return message;
|
|
312
328
|
},
|
|
313
329
|
};
|
|
@@ -463,6 +479,9 @@ exports.BDTransactionResponse = {
|
|
|
463
479
|
return message;
|
|
464
480
|
},
|
|
465
481
|
};
|
|
482
|
+
function isObject(value) {
|
|
483
|
+
return typeof value === "object" && value !== null;
|
|
484
|
+
}
|
|
466
485
|
function isSet(value) {
|
|
467
486
|
return value !== null && value !== undefined;
|
|
468
487
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
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
|
+
null_value?: NullValue | undefined;
|
|
47
|
+
/** Represents a double value. */
|
|
48
|
+
number_value?: number | undefined;
|
|
49
|
+
/** Represents a string value. */
|
|
50
|
+
string_value?: string | undefined;
|
|
51
|
+
/** Represents a boolean value. */
|
|
52
|
+
bool_value?: boolean | undefined;
|
|
53
|
+
/** Represents a structured value. */
|
|
54
|
+
struct_value?: {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
} | undefined;
|
|
57
|
+
/** Represents a repeated `Value`. */
|
|
58
|
+
list_value?: 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: {
|
|
70
|
+
encode(message: Struct, writer?: _m0.Writer): _m0.Writer;
|
|
71
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct;
|
|
72
|
+
fromJSON(object: any): Struct;
|
|
73
|
+
toJSON(message: Struct): unknown;
|
|
74
|
+
create<I extends Exact<DeepPartial<Struct>, I>>(base?: I): Struct;
|
|
75
|
+
fromPartial<I extends Exact<DeepPartial<Struct>, I>>(object: I): Struct;
|
|
76
|
+
wrap(object: {
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
} | undefined): Struct;
|
|
79
|
+
unwrap(message: Struct): {
|
|
80
|
+
[key: string]: any;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export declare const Struct_FieldsEntry: {
|
|
84
|
+
encode(message: Struct_FieldsEntry, writer?: _m0.Writer): _m0.Writer;
|
|
85
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry;
|
|
86
|
+
fromJSON(object: any): Struct_FieldsEntry;
|
|
87
|
+
toJSON(message: Struct_FieldsEntry): unknown;
|
|
88
|
+
create<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(base?: I): Struct_FieldsEntry;
|
|
89
|
+
fromPartial<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(object: I): Struct_FieldsEntry;
|
|
90
|
+
};
|
|
91
|
+
export declare const Value: {
|
|
92
|
+
encode(message: Value, writer?: _m0.Writer): _m0.Writer;
|
|
93
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Value;
|
|
94
|
+
fromJSON(object: any): Value;
|
|
95
|
+
toJSON(message: Value): unknown;
|
|
96
|
+
create<I extends Exact<DeepPartial<Value>, I>>(base?: I): Value;
|
|
97
|
+
fromPartial<I extends Exact<DeepPartial<Value>, I>>(object: I): Value;
|
|
98
|
+
wrap(value: any): Value;
|
|
99
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
|
|
100
|
+
};
|
|
101
|
+
export declare const ListValue: {
|
|
102
|
+
encode(message: ListValue, writer?: _m0.Writer): _m0.Writer;
|
|
103
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ListValue;
|
|
104
|
+
fromJSON(object: any): ListValue;
|
|
105
|
+
toJSON(message: ListValue): unknown;
|
|
106
|
+
create<I extends Exact<DeepPartial<ListValue>, I>>(base?: I): ListValue;
|
|
107
|
+
fromPartial<I extends Exact<DeepPartial<ListValue>, I>>(object: I): ListValue;
|
|
108
|
+
wrap(array: Array<any> | undefined): ListValue;
|
|
109
|
+
unwrap(message: ListValue): Array<any>;
|
|
110
|
+
};
|
|
111
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
112
|
+
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 {} ? {
|
|
113
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
114
|
+
} : Partial<T>;
|
|
115
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
116
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
117
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
118
|
+
} & {
|
|
119
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
120
|
+
};
|
|
121
|
+
export {};
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v1.181.2
|
|
5
|
+
// protoc v6.33.2
|
|
6
|
+
// source: google/protobuf/struct.proto
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.ListValue = exports.Value = exports.Struct_FieldsEntry = exports.Struct = exports.NullValue = exports.protobufPackage = void 0;
|
|
12
|
+
exports.nullValueFromJSON = nullValueFromJSON;
|
|
13
|
+
exports.nullValueToJSON = nullValueToJSON;
|
|
14
|
+
/* eslint-disable */
|
|
15
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
16
|
+
exports.protobufPackage = "google.protobuf";
|
|
17
|
+
/**
|
|
18
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
19
|
+
* `Value` type union.
|
|
20
|
+
*
|
|
21
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
22
|
+
*/
|
|
23
|
+
var NullValue;
|
|
24
|
+
(function (NullValue) {
|
|
25
|
+
/** NULL_VALUE - Null value. */
|
|
26
|
+
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
27
|
+
NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
28
|
+
})(NullValue || (exports.NullValue = NullValue = {}));
|
|
29
|
+
function nullValueFromJSON(object) {
|
|
30
|
+
switch (object) {
|
|
31
|
+
case 0:
|
|
32
|
+
case "NULL_VALUE":
|
|
33
|
+
return NullValue.NULL_VALUE;
|
|
34
|
+
case -1:
|
|
35
|
+
case "UNRECOGNIZED":
|
|
36
|
+
default:
|
|
37
|
+
return NullValue.UNRECOGNIZED;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function nullValueToJSON(object) {
|
|
41
|
+
switch (object) {
|
|
42
|
+
case NullValue.NULL_VALUE:
|
|
43
|
+
return "NULL_VALUE";
|
|
44
|
+
case NullValue.UNRECOGNIZED:
|
|
45
|
+
default:
|
|
46
|
+
return "UNRECOGNIZED";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function createBaseStruct() {
|
|
50
|
+
return { fields: {} };
|
|
51
|
+
}
|
|
52
|
+
exports.Struct = {
|
|
53
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
54
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
|
55
|
+
if (value !== undefined) {
|
|
56
|
+
exports.Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).ldelim();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return writer;
|
|
60
|
+
},
|
|
61
|
+
decode(input, length) {
|
|
62
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
63
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
64
|
+
const message = createBaseStruct();
|
|
65
|
+
while (reader.pos < end) {
|
|
66
|
+
const tag = reader.uint32();
|
|
67
|
+
switch (tag >>> 3) {
|
|
68
|
+
case 1:
|
|
69
|
+
if (tag !== 10) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
const entry1 = exports.Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
73
|
+
if (entry1.value !== undefined) {
|
|
74
|
+
message.fields[entry1.key] = entry1.value;
|
|
75
|
+
}
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
reader.skipType(tag & 7);
|
|
82
|
+
}
|
|
83
|
+
return message;
|
|
84
|
+
},
|
|
85
|
+
fromJSON(object) {
|
|
86
|
+
return {
|
|
87
|
+
fields: isObject(object.fields)
|
|
88
|
+
? Object.entries(object.fields).reduce((acc, [key, value]) => {
|
|
89
|
+
acc[key] = value;
|
|
90
|
+
return acc;
|
|
91
|
+
}, {})
|
|
92
|
+
: {},
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
toJSON(message) {
|
|
96
|
+
const obj = {};
|
|
97
|
+
if (message.fields) {
|
|
98
|
+
const entries = Object.entries(message.fields);
|
|
99
|
+
if (entries.length > 0) {
|
|
100
|
+
obj.fields = {};
|
|
101
|
+
entries.forEach(([k, v]) => {
|
|
102
|
+
obj.fields[k] = v;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return obj;
|
|
107
|
+
},
|
|
108
|
+
create(base) {
|
|
109
|
+
return exports.Struct.fromPartial(base ?? {});
|
|
110
|
+
},
|
|
111
|
+
fromPartial(object) {
|
|
112
|
+
const message = createBaseStruct();
|
|
113
|
+
message.fields = Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
|
|
114
|
+
if (value !== undefined) {
|
|
115
|
+
acc[key] = value;
|
|
116
|
+
}
|
|
117
|
+
return acc;
|
|
118
|
+
}, {});
|
|
119
|
+
return message;
|
|
120
|
+
},
|
|
121
|
+
wrap(object) {
|
|
122
|
+
const struct = createBaseStruct();
|
|
123
|
+
if (object !== undefined) {
|
|
124
|
+
for (const key of Object.keys(object)) {
|
|
125
|
+
struct.fields[key] = object[key];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return struct;
|
|
129
|
+
},
|
|
130
|
+
unwrap(message) {
|
|
131
|
+
const object = {};
|
|
132
|
+
if (message.fields) {
|
|
133
|
+
for (const key of Object.keys(message.fields)) {
|
|
134
|
+
object[key] = message.fields[key];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return object;
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
function createBaseStruct_FieldsEntry() {
|
|
141
|
+
return { key: "", value: undefined };
|
|
142
|
+
}
|
|
143
|
+
exports.Struct_FieldsEntry = {
|
|
144
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
145
|
+
if (message.key !== "") {
|
|
146
|
+
writer.uint32(10).string(message.key);
|
|
147
|
+
}
|
|
148
|
+
if (message.value !== undefined) {
|
|
149
|
+
exports.Value.encode(exports.Value.wrap(message.value), writer.uint32(18).fork()).ldelim();
|
|
150
|
+
}
|
|
151
|
+
return writer;
|
|
152
|
+
},
|
|
153
|
+
decode(input, length) {
|
|
154
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
155
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
156
|
+
const message = createBaseStruct_FieldsEntry();
|
|
157
|
+
while (reader.pos < end) {
|
|
158
|
+
const tag = reader.uint32();
|
|
159
|
+
switch (tag >>> 3) {
|
|
160
|
+
case 1:
|
|
161
|
+
if (tag !== 10) {
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
message.key = reader.string();
|
|
165
|
+
continue;
|
|
166
|
+
case 2:
|
|
167
|
+
if (tag !== 18) {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
message.value = exports.Value.unwrap(exports.Value.decode(reader, reader.uint32()));
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
reader.skipType(tag & 7);
|
|
177
|
+
}
|
|
178
|
+
return message;
|
|
179
|
+
},
|
|
180
|
+
fromJSON(object) {
|
|
181
|
+
return {
|
|
182
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
183
|
+
value: isSet(object?.value) ? object.value : undefined,
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
toJSON(message) {
|
|
187
|
+
const obj = {};
|
|
188
|
+
if (message.key !== "") {
|
|
189
|
+
obj.key = message.key;
|
|
190
|
+
}
|
|
191
|
+
if (message.value !== undefined) {
|
|
192
|
+
obj.value = message.value;
|
|
193
|
+
}
|
|
194
|
+
return obj;
|
|
195
|
+
},
|
|
196
|
+
create(base) {
|
|
197
|
+
return exports.Struct_FieldsEntry.fromPartial(base ?? {});
|
|
198
|
+
},
|
|
199
|
+
fromPartial(object) {
|
|
200
|
+
const message = createBaseStruct_FieldsEntry();
|
|
201
|
+
message.key = object.key ?? "";
|
|
202
|
+
message.value = object.value ?? undefined;
|
|
203
|
+
return message;
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
function createBaseValue() {
|
|
207
|
+
return {
|
|
208
|
+
null_value: undefined,
|
|
209
|
+
number_value: undefined,
|
|
210
|
+
string_value: undefined,
|
|
211
|
+
bool_value: undefined,
|
|
212
|
+
struct_value: undefined,
|
|
213
|
+
list_value: undefined,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
exports.Value = {
|
|
217
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
218
|
+
if (message.null_value !== undefined) {
|
|
219
|
+
writer.uint32(8).int32(message.null_value);
|
|
220
|
+
}
|
|
221
|
+
if (message.number_value !== undefined) {
|
|
222
|
+
writer.uint32(17).double(message.number_value);
|
|
223
|
+
}
|
|
224
|
+
if (message.string_value !== undefined) {
|
|
225
|
+
writer.uint32(26).string(message.string_value);
|
|
226
|
+
}
|
|
227
|
+
if (message.bool_value !== undefined) {
|
|
228
|
+
writer.uint32(32).bool(message.bool_value);
|
|
229
|
+
}
|
|
230
|
+
if (message.struct_value !== undefined) {
|
|
231
|
+
exports.Struct.encode(exports.Struct.wrap(message.struct_value), writer.uint32(42).fork()).ldelim();
|
|
232
|
+
}
|
|
233
|
+
if (message.list_value !== undefined) {
|
|
234
|
+
exports.ListValue.encode(exports.ListValue.wrap(message.list_value), writer.uint32(50).fork()).ldelim();
|
|
235
|
+
}
|
|
236
|
+
return writer;
|
|
237
|
+
},
|
|
238
|
+
decode(input, length) {
|
|
239
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
240
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
241
|
+
const message = createBaseValue();
|
|
242
|
+
while (reader.pos < end) {
|
|
243
|
+
const tag = reader.uint32();
|
|
244
|
+
switch (tag >>> 3) {
|
|
245
|
+
case 1:
|
|
246
|
+
if (tag !== 8) {
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
message.null_value = reader.int32();
|
|
250
|
+
continue;
|
|
251
|
+
case 2:
|
|
252
|
+
if (tag !== 17) {
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
message.number_value = reader.double();
|
|
256
|
+
continue;
|
|
257
|
+
case 3:
|
|
258
|
+
if (tag !== 26) {
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
message.string_value = reader.string();
|
|
262
|
+
continue;
|
|
263
|
+
case 4:
|
|
264
|
+
if (tag !== 32) {
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
message.bool_value = reader.bool();
|
|
268
|
+
continue;
|
|
269
|
+
case 5:
|
|
270
|
+
if (tag !== 42) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
message.struct_value = exports.Struct.unwrap(exports.Struct.decode(reader, reader.uint32()));
|
|
274
|
+
continue;
|
|
275
|
+
case 6:
|
|
276
|
+
if (tag !== 50) {
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
message.list_value = exports.ListValue.unwrap(exports.ListValue.decode(reader, reader.uint32()));
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
reader.skipType(tag & 7);
|
|
286
|
+
}
|
|
287
|
+
return message;
|
|
288
|
+
},
|
|
289
|
+
fromJSON(object) {
|
|
290
|
+
return {
|
|
291
|
+
null_value: isSet(object.null_value) ? nullValueFromJSON(object.null_value) : undefined,
|
|
292
|
+
number_value: isSet(object.number_value) ? globalThis.Number(object.number_value) : undefined,
|
|
293
|
+
string_value: isSet(object.string_value) ? globalThis.String(object.string_value) : undefined,
|
|
294
|
+
bool_value: isSet(object.bool_value) ? globalThis.Boolean(object.bool_value) : undefined,
|
|
295
|
+
struct_value: isObject(object.struct_value) ? object.struct_value : undefined,
|
|
296
|
+
list_value: globalThis.Array.isArray(object.list_value) ? [...object.list_value] : undefined,
|
|
297
|
+
};
|
|
298
|
+
},
|
|
299
|
+
toJSON(message) {
|
|
300
|
+
const obj = {};
|
|
301
|
+
if (message.null_value !== undefined) {
|
|
302
|
+
obj.null_value = nullValueToJSON(message.null_value);
|
|
303
|
+
}
|
|
304
|
+
if (message.number_value !== undefined) {
|
|
305
|
+
obj.number_value = message.number_value;
|
|
306
|
+
}
|
|
307
|
+
if (message.string_value !== undefined) {
|
|
308
|
+
obj.string_value = message.string_value;
|
|
309
|
+
}
|
|
310
|
+
if (message.bool_value !== undefined) {
|
|
311
|
+
obj.bool_value = message.bool_value;
|
|
312
|
+
}
|
|
313
|
+
if (message.struct_value !== undefined) {
|
|
314
|
+
obj.struct_value = message.struct_value;
|
|
315
|
+
}
|
|
316
|
+
if (message.list_value !== undefined) {
|
|
317
|
+
obj.list_value = message.list_value;
|
|
318
|
+
}
|
|
319
|
+
return obj;
|
|
320
|
+
},
|
|
321
|
+
create(base) {
|
|
322
|
+
return exports.Value.fromPartial(base ?? {});
|
|
323
|
+
},
|
|
324
|
+
fromPartial(object) {
|
|
325
|
+
const message = createBaseValue();
|
|
326
|
+
message.null_value = object.null_value ?? undefined;
|
|
327
|
+
message.number_value = object.number_value ?? undefined;
|
|
328
|
+
message.string_value = object.string_value ?? undefined;
|
|
329
|
+
message.bool_value = object.bool_value ?? undefined;
|
|
330
|
+
message.struct_value = object.struct_value ?? undefined;
|
|
331
|
+
message.list_value = object.list_value ?? undefined;
|
|
332
|
+
return message;
|
|
333
|
+
},
|
|
334
|
+
wrap(value) {
|
|
335
|
+
const result = createBaseValue();
|
|
336
|
+
if (value === null) {
|
|
337
|
+
result.null_value = NullValue.NULL_VALUE;
|
|
338
|
+
}
|
|
339
|
+
else if (typeof value === "boolean") {
|
|
340
|
+
result.bool_value = value;
|
|
341
|
+
}
|
|
342
|
+
else if (typeof value === "number") {
|
|
343
|
+
result.number_value = value;
|
|
344
|
+
}
|
|
345
|
+
else if (typeof value === "string") {
|
|
346
|
+
result.string_value = value;
|
|
347
|
+
}
|
|
348
|
+
else if (globalThis.Array.isArray(value)) {
|
|
349
|
+
result.list_value = value;
|
|
350
|
+
}
|
|
351
|
+
else if (typeof value === "object") {
|
|
352
|
+
result.struct_value = value;
|
|
353
|
+
}
|
|
354
|
+
else if (typeof value !== "undefined") {
|
|
355
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
356
|
+
}
|
|
357
|
+
return result;
|
|
358
|
+
},
|
|
359
|
+
unwrap(message) {
|
|
360
|
+
if (message.string_value !== undefined) {
|
|
361
|
+
return message.string_value;
|
|
362
|
+
}
|
|
363
|
+
else if (message?.number_value !== undefined) {
|
|
364
|
+
return message.number_value;
|
|
365
|
+
}
|
|
366
|
+
else if (message?.bool_value !== undefined) {
|
|
367
|
+
return message.bool_value;
|
|
368
|
+
}
|
|
369
|
+
else if (message?.struct_value !== undefined) {
|
|
370
|
+
return message.struct_value;
|
|
371
|
+
}
|
|
372
|
+
else if (message?.list_value !== undefined) {
|
|
373
|
+
return message.list_value;
|
|
374
|
+
}
|
|
375
|
+
else if (message?.null_value !== undefined) {
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
return undefined;
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
function createBaseListValue() {
|
|
382
|
+
return { values: [] };
|
|
383
|
+
}
|
|
384
|
+
exports.ListValue = {
|
|
385
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
386
|
+
for (const v of message.values) {
|
|
387
|
+
exports.Value.encode(exports.Value.wrap(v), writer.uint32(10).fork()).ldelim();
|
|
388
|
+
}
|
|
389
|
+
return writer;
|
|
390
|
+
},
|
|
391
|
+
decode(input, length) {
|
|
392
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
393
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
394
|
+
const message = createBaseListValue();
|
|
395
|
+
while (reader.pos < end) {
|
|
396
|
+
const tag = reader.uint32();
|
|
397
|
+
switch (tag >>> 3) {
|
|
398
|
+
case 1:
|
|
399
|
+
if (tag !== 10) {
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
message.values.push(exports.Value.unwrap(exports.Value.decode(reader, reader.uint32())));
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
reader.skipType(tag & 7);
|
|
409
|
+
}
|
|
410
|
+
return message;
|
|
411
|
+
},
|
|
412
|
+
fromJSON(object) {
|
|
413
|
+
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
414
|
+
},
|
|
415
|
+
toJSON(message) {
|
|
416
|
+
const obj = {};
|
|
417
|
+
if (message.values?.length) {
|
|
418
|
+
obj.values = message.values;
|
|
419
|
+
}
|
|
420
|
+
return obj;
|
|
421
|
+
},
|
|
422
|
+
create(base) {
|
|
423
|
+
return exports.ListValue.fromPartial(base ?? {});
|
|
424
|
+
},
|
|
425
|
+
fromPartial(object) {
|
|
426
|
+
const message = createBaseListValue();
|
|
427
|
+
message.values = object.values?.map((e) => e) || [];
|
|
428
|
+
return message;
|
|
429
|
+
},
|
|
430
|
+
wrap(array) {
|
|
431
|
+
const result = createBaseListValue();
|
|
432
|
+
result.values = array ?? [];
|
|
433
|
+
return result;
|
|
434
|
+
},
|
|
435
|
+
unwrap(message) {
|
|
436
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
437
|
+
return message.values;
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
return message;
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
};
|
|
444
|
+
function isObject(value) {
|
|
445
|
+
return typeof value === "object" && value !== null;
|
|
446
|
+
}
|
|
447
|
+
function isSet(value) {
|
|
448
|
+
return value !== null && value !== undefined;
|
|
449
|
+
}
|