mezon-js 2.8.58 → 2.8.60
Sign up to get free protection for your applications and to get access to all the features.
- package/api/api.ts +20099 -19515
- package/dist/mezon-js.cjs.js +2 -2
- package/dist/mezon-js.esm.mjs +2 -2
- package/dist/socket.d.ts +3 -2
- package/google/protobuf/struct.ts +485 -0
- package/google/protobuf/timestamp.ts +220 -220
- package/google/protobuf/wrappers.ts +626 -626
- package/package.json +1 -1
- package/rtapi/realtime.ts +7751 -6670
- package/socket.ts +5 -3
package/dist/mezon-js.cjs.js
CHANGED
@@ -5038,9 +5038,9 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5038
5038
|
return response.message_typing_event;
|
5039
5039
|
});
|
5040
5040
|
}
|
5041
|
-
writeLastSeenMessage(clan_id, channel_id, mode,
|
5041
|
+
writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds) {
|
5042
5042
|
return __async(this, null, function* () {
|
5043
|
-
const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode,
|
5043
|
+
const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode, message_id, timestamp_seconds } });
|
5044
5044
|
return response.last_seen_message_event;
|
5045
5045
|
});
|
5046
5046
|
}
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -5009,9 +5009,9 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5009
5009
|
return response.message_typing_event;
|
5010
5010
|
});
|
5011
5011
|
}
|
5012
|
-
writeLastSeenMessage(clan_id, channel_id, mode,
|
5012
|
+
writeLastSeenMessage(clan_id, channel_id, mode, message_id, timestamp_seconds) {
|
5013
5013
|
return __async(this, null, function* () {
|
5014
|
-
const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode,
|
5014
|
+
const response = yield this.send({ last_seen_message_event: { clan_id, channel_id, mode, message_id, timestamp_seconds } });
|
5015
5015
|
return response.last_seen_message_event;
|
5016
5016
|
});
|
5017
5017
|
}
|
package/dist/socket.d.ts
CHANGED
@@ -83,6 +83,7 @@ export interface UserChannelAddedEvent {
|
|
83
83
|
status: string;
|
84
84
|
clan_id: string;
|
85
85
|
channel_type: number;
|
86
|
+
is_public: boolean;
|
86
87
|
}
|
87
88
|
export interface AddUsers {
|
88
89
|
user_id: string;
|
@@ -523,7 +524,7 @@ export interface Socket {
|
|
523
524
|
/** Send message reaction */
|
524
525
|
writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<ApiMessageReaction>;
|
525
526
|
/** Send last seen message */
|
526
|
-
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number,
|
527
|
+
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent>;
|
527
528
|
/** Send last pin message */
|
528
529
|
writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
|
529
530
|
/** Send custom user status */
|
@@ -670,7 +671,7 @@ export declare class DefaultSocket implements Socket {
|
|
670
671
|
writeChatMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean, avatar?: string): Promise<ChannelMessageAck>;
|
671
672
|
writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<ApiMessageReaction>;
|
672
673
|
writeMessageTyping(clan_id: string, channel_id: string, mode: number): Promise<MessageTypingEvent>;
|
673
|
-
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number,
|
674
|
+
writeLastSeenMessage(clan_id: string, channel_id: string, mode: number, message_id: string, timestamp_seconds: number): Promise<LastSeenMessageEvent>;
|
674
675
|
writeLastPinMessage(clan_id: string, channel_id: string, mode: number, is_public: boolean, message_id: string, timestamp_seconds: number, operation: number): Promise<LastPinMessageEvent>;
|
675
676
|
writeVoiceJoined(id: string, clanId: string, clanName: string, voiceChannelId: string, voiceChannelLabel: string, participant: string, lastScreenshot: string): Promise<VoiceJoinedEvent>;
|
676
677
|
writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
|
@@ -0,0 +1,485 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
import _m0 from "protobufjs/minimal";
|
3
|
+
|
4
|
+
export const protobufPackage = "google.protobuf";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
8
|
+
* `Value` type union.
|
9
|
+
*
|
10
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
11
|
+
*/
|
12
|
+
export enum NullValue {
|
13
|
+
/** NULL_VALUE - Null value. */
|
14
|
+
NULL_VALUE = 0,
|
15
|
+
UNRECOGNIZED = -1,
|
16
|
+
}
|
17
|
+
|
18
|
+
export function nullValueFromJSON(object: any): NullValue {
|
19
|
+
switch (object) {
|
20
|
+
case 0:
|
21
|
+
case "NULL_VALUE":
|
22
|
+
return NullValue.NULL_VALUE;
|
23
|
+
case -1:
|
24
|
+
case "UNRECOGNIZED":
|
25
|
+
default:
|
26
|
+
return NullValue.UNRECOGNIZED;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
export function nullValueToJSON(object: NullValue): string {
|
31
|
+
switch (object) {
|
32
|
+
case NullValue.NULL_VALUE:
|
33
|
+
return "NULL_VALUE";
|
34
|
+
case NullValue.UNRECOGNIZED:
|
35
|
+
default:
|
36
|
+
return "UNRECOGNIZED";
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
/**
|
41
|
+
* `Struct` represents a structured data value, consisting of fields
|
42
|
+
* which map to dynamically typed values. In some languages, `Struct`
|
43
|
+
* might be supported by a native representation. For example, in
|
44
|
+
* scripting languages like JS a struct is represented as an
|
45
|
+
* object. The details of that representation are described together
|
46
|
+
* with the proto support for the language.
|
47
|
+
*
|
48
|
+
* The JSON representation for `Struct` is JSON object.
|
49
|
+
*/
|
50
|
+
export interface Struct {
|
51
|
+
/** Unordered map of dynamically typed values. */
|
52
|
+
fields: { [key: string]: any | undefined };
|
53
|
+
}
|
54
|
+
|
55
|
+
export interface Struct_FieldsEntry {
|
56
|
+
key: string;
|
57
|
+
value: any | undefined;
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* `Value` represents a dynamically typed value which can be either
|
62
|
+
* null, a number, a string, a boolean, a recursive struct value, or a
|
63
|
+
* list of values. A producer of value is expected to set one of these
|
64
|
+
* variants. Absence of any variant indicates an error.
|
65
|
+
*
|
66
|
+
* The JSON representation for `Value` is JSON value.
|
67
|
+
*/
|
68
|
+
export interface Value {
|
69
|
+
/** Represents a null value. */
|
70
|
+
null_value?:
|
71
|
+
| NullValue
|
72
|
+
| undefined;
|
73
|
+
/** Represents a double value. */
|
74
|
+
number_value?:
|
75
|
+
| number
|
76
|
+
| undefined;
|
77
|
+
/** Represents a string value. */
|
78
|
+
string_value?:
|
79
|
+
| string
|
80
|
+
| undefined;
|
81
|
+
/** Represents a boolean value. */
|
82
|
+
bool_value?:
|
83
|
+
| boolean
|
84
|
+
| undefined;
|
85
|
+
/** Represents a structured value. */
|
86
|
+
struct_value?:
|
87
|
+
| { [key: string]: any }
|
88
|
+
| undefined;
|
89
|
+
/** Represents a repeated `Value`. */
|
90
|
+
list_value?: Array<any> | undefined;
|
91
|
+
}
|
92
|
+
|
93
|
+
/**
|
94
|
+
* `ListValue` is a wrapper around a repeated field of values.
|
95
|
+
*
|
96
|
+
* The JSON representation for `ListValue` is JSON array.
|
97
|
+
*/
|
98
|
+
export interface ListValue {
|
99
|
+
/** Repeated field of dynamically typed values. */
|
100
|
+
values: any[];
|
101
|
+
}
|
102
|
+
|
103
|
+
function createBaseStruct(): Struct {
|
104
|
+
return { fields: {} };
|
105
|
+
}
|
106
|
+
|
107
|
+
export const Struct = {
|
108
|
+
encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
109
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
110
|
+
if (value !== undefined) {
|
111
|
+
Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim();
|
112
|
+
}
|
113
|
+
});
|
114
|
+
return writer;
|
115
|
+
},
|
116
|
+
|
117
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct {
|
118
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
119
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
120
|
+
const message = createBaseStruct();
|
121
|
+
while (reader.pos < end) {
|
122
|
+
const tag = reader.uint32();
|
123
|
+
switch (tag >>> 3) {
|
124
|
+
case 1:
|
125
|
+
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
126
|
+
if (entry1.value !== undefined) {
|
127
|
+
message.fields[entry1.key] = entry1.value;
|
128
|
+
}
|
129
|
+
break;
|
130
|
+
default:
|
131
|
+
reader.skipType(tag & 7);
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
return message;
|
136
|
+
},
|
137
|
+
|
138
|
+
fromJSON(object: any): Struct {
|
139
|
+
return {
|
140
|
+
fields: isObject(object.fields)
|
141
|
+
? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
|
142
|
+
acc[key] = value as any | undefined;
|
143
|
+
return acc;
|
144
|
+
}, {})
|
145
|
+
: {},
|
146
|
+
};
|
147
|
+
},
|
148
|
+
|
149
|
+
toJSON(message: Struct): unknown {
|
150
|
+
const obj: any = {};
|
151
|
+
obj.fields = {};
|
152
|
+
if (message.fields) {
|
153
|
+
Object.entries(message.fields).forEach(([k, v]) => {
|
154
|
+
obj.fields[k] = v;
|
155
|
+
});
|
156
|
+
}
|
157
|
+
return obj;
|
158
|
+
},
|
159
|
+
|
160
|
+
create<I extends Exact<DeepPartial<Struct>, I>>(base?: I): Struct {
|
161
|
+
return Struct.fromPartial(base ?? {});
|
162
|
+
},
|
163
|
+
|
164
|
+
fromPartial<I extends Exact<DeepPartial<Struct>, I>>(object: I): Struct {
|
165
|
+
const message = createBaseStruct();
|
166
|
+
message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>(
|
167
|
+
(acc, [key, value]) => {
|
168
|
+
if (value !== undefined) {
|
169
|
+
acc[key] = value;
|
170
|
+
}
|
171
|
+
return acc;
|
172
|
+
},
|
173
|
+
{},
|
174
|
+
);
|
175
|
+
return message;
|
176
|
+
},
|
177
|
+
|
178
|
+
wrap(object: { [key: string]: any } | undefined): Struct {
|
179
|
+
const struct = createBaseStruct();
|
180
|
+
if (object !== undefined) {
|
181
|
+
Object.keys(object).forEach((key) => {
|
182
|
+
struct.fields[key] = object[key];
|
183
|
+
});
|
184
|
+
}
|
185
|
+
return struct;
|
186
|
+
},
|
187
|
+
|
188
|
+
unwrap(message: Struct): { [key: string]: any } {
|
189
|
+
const object: { [key: string]: any } = {};
|
190
|
+
Object.keys(message.fields).forEach((key) => {
|
191
|
+
object[key] = message.fields[key];
|
192
|
+
});
|
193
|
+
return object;
|
194
|
+
},
|
195
|
+
};
|
196
|
+
|
197
|
+
function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
|
198
|
+
return { key: "", value: undefined };
|
199
|
+
}
|
200
|
+
|
201
|
+
export const Struct_FieldsEntry = {
|
202
|
+
encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
203
|
+
if (message.key !== "") {
|
204
|
+
writer.uint32(10).string(message.key);
|
205
|
+
}
|
206
|
+
if (message.value !== undefined) {
|
207
|
+
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim();
|
208
|
+
}
|
209
|
+
return writer;
|
210
|
+
},
|
211
|
+
|
212
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry {
|
213
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
214
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
215
|
+
const message = createBaseStruct_FieldsEntry();
|
216
|
+
while (reader.pos < end) {
|
217
|
+
const tag = reader.uint32();
|
218
|
+
switch (tag >>> 3) {
|
219
|
+
case 1:
|
220
|
+
message.key = reader.string();
|
221
|
+
break;
|
222
|
+
case 2:
|
223
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
224
|
+
break;
|
225
|
+
default:
|
226
|
+
reader.skipType(tag & 7);
|
227
|
+
break;
|
228
|
+
}
|
229
|
+
}
|
230
|
+
return message;
|
231
|
+
},
|
232
|
+
|
233
|
+
fromJSON(object: any): Struct_FieldsEntry {
|
234
|
+
return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object?.value) ? object.value : undefined };
|
235
|
+
},
|
236
|
+
|
237
|
+
toJSON(message: Struct_FieldsEntry): unknown {
|
238
|
+
const obj: any = {};
|
239
|
+
message.key !== undefined && (obj.key = message.key);
|
240
|
+
message.value !== undefined && (obj.value = message.value);
|
241
|
+
return obj;
|
242
|
+
},
|
243
|
+
|
244
|
+
create<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(base?: I): Struct_FieldsEntry {
|
245
|
+
return Struct_FieldsEntry.fromPartial(base ?? {});
|
246
|
+
},
|
247
|
+
|
248
|
+
fromPartial<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(object: I): Struct_FieldsEntry {
|
249
|
+
const message = createBaseStruct_FieldsEntry();
|
250
|
+
message.key = object.key ?? "";
|
251
|
+
message.value = object.value ?? undefined;
|
252
|
+
return message;
|
253
|
+
},
|
254
|
+
};
|
255
|
+
|
256
|
+
function createBaseValue(): Value {
|
257
|
+
return {
|
258
|
+
null_value: undefined,
|
259
|
+
number_value: undefined,
|
260
|
+
string_value: undefined,
|
261
|
+
bool_value: undefined,
|
262
|
+
struct_value: undefined,
|
263
|
+
list_value: undefined,
|
264
|
+
};
|
265
|
+
}
|
266
|
+
|
267
|
+
export const Value = {
|
268
|
+
encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
269
|
+
if (message.null_value !== undefined) {
|
270
|
+
writer.uint32(8).int32(message.null_value);
|
271
|
+
}
|
272
|
+
if (message.number_value !== undefined) {
|
273
|
+
writer.uint32(17).double(message.number_value);
|
274
|
+
}
|
275
|
+
if (message.string_value !== undefined) {
|
276
|
+
writer.uint32(26).string(message.string_value);
|
277
|
+
}
|
278
|
+
if (message.bool_value !== undefined) {
|
279
|
+
writer.uint32(32).bool(message.bool_value);
|
280
|
+
}
|
281
|
+
if (message.struct_value !== undefined) {
|
282
|
+
Struct.encode(Struct.wrap(message.struct_value), writer.uint32(42).fork()).ldelim();
|
283
|
+
}
|
284
|
+
if (message.list_value !== undefined) {
|
285
|
+
ListValue.encode(ListValue.wrap(message.list_value), writer.uint32(50).fork()).ldelim();
|
286
|
+
}
|
287
|
+
return writer;
|
288
|
+
},
|
289
|
+
|
290
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Value {
|
291
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
292
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
293
|
+
const message = createBaseValue();
|
294
|
+
while (reader.pos < end) {
|
295
|
+
const tag = reader.uint32();
|
296
|
+
switch (tag >>> 3) {
|
297
|
+
case 1:
|
298
|
+
message.null_value = reader.int32() as any;
|
299
|
+
break;
|
300
|
+
case 2:
|
301
|
+
message.number_value = reader.double();
|
302
|
+
break;
|
303
|
+
case 3:
|
304
|
+
message.string_value = reader.string();
|
305
|
+
break;
|
306
|
+
case 4:
|
307
|
+
message.bool_value = reader.bool();
|
308
|
+
break;
|
309
|
+
case 5:
|
310
|
+
message.struct_value = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
311
|
+
break;
|
312
|
+
case 6:
|
313
|
+
message.list_value = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
314
|
+
break;
|
315
|
+
default:
|
316
|
+
reader.skipType(tag & 7);
|
317
|
+
break;
|
318
|
+
}
|
319
|
+
}
|
320
|
+
return message;
|
321
|
+
},
|
322
|
+
|
323
|
+
fromJSON(object: any): Value {
|
324
|
+
return {
|
325
|
+
null_value: isSet(object.null_value) ? nullValueFromJSON(object.null_value) : undefined,
|
326
|
+
number_value: isSet(object.number_value) ? Number(object.number_value) : undefined,
|
327
|
+
string_value: isSet(object.string_value) ? String(object.string_value) : undefined,
|
328
|
+
bool_value: isSet(object.bool_value) ? Boolean(object.bool_value) : undefined,
|
329
|
+
struct_value: isObject(object.struct_value) ? object.struct_value : undefined,
|
330
|
+
list_value: Array.isArray(object.list_value) ? [...object.list_value] : undefined,
|
331
|
+
};
|
332
|
+
},
|
333
|
+
|
334
|
+
toJSON(message: Value): unknown {
|
335
|
+
const obj: any = {};
|
336
|
+
message.null_value !== undefined &&
|
337
|
+
(obj.null_value = message.null_value !== undefined ? nullValueToJSON(message.null_value) : undefined);
|
338
|
+
message.number_value !== undefined && (obj.number_value = message.number_value);
|
339
|
+
message.string_value !== undefined && (obj.string_value = message.string_value);
|
340
|
+
message.bool_value !== undefined && (obj.bool_value = message.bool_value);
|
341
|
+
message.struct_value !== undefined && (obj.struct_value = message.struct_value);
|
342
|
+
message.list_value !== undefined && (obj.list_value = message.list_value);
|
343
|
+
return obj;
|
344
|
+
},
|
345
|
+
|
346
|
+
create<I extends Exact<DeepPartial<Value>, I>>(base?: I): Value {
|
347
|
+
return Value.fromPartial(base ?? {});
|
348
|
+
},
|
349
|
+
|
350
|
+
fromPartial<I extends Exact<DeepPartial<Value>, I>>(object: I): Value {
|
351
|
+
const message = createBaseValue();
|
352
|
+
message.null_value = object.null_value ?? undefined;
|
353
|
+
message.number_value = object.number_value ?? undefined;
|
354
|
+
message.string_value = object.string_value ?? undefined;
|
355
|
+
message.bool_value = object.bool_value ?? undefined;
|
356
|
+
message.struct_value = object.struct_value ?? undefined;
|
357
|
+
message.list_value = object.list_value ?? undefined;
|
358
|
+
return message;
|
359
|
+
},
|
360
|
+
|
361
|
+
wrap(value: any): Value {
|
362
|
+
const result = createBaseValue();
|
363
|
+
|
364
|
+
if (value === null) {
|
365
|
+
result.null_value = NullValue.NULL_VALUE;
|
366
|
+
} else if (typeof value === "boolean") {
|
367
|
+
result.bool_value = value;
|
368
|
+
} else if (typeof value === "number") {
|
369
|
+
result.number_value = value;
|
370
|
+
} else if (typeof value === "string") {
|
371
|
+
result.string_value = value;
|
372
|
+
} else if (Array.isArray(value)) {
|
373
|
+
result.list_value = value;
|
374
|
+
} else if (typeof value === "object") {
|
375
|
+
result.struct_value = value;
|
376
|
+
} else if (typeof value !== "undefined") {
|
377
|
+
throw new Error("Unsupported any value type: " + typeof value);
|
378
|
+
}
|
379
|
+
|
380
|
+
return result;
|
381
|
+
},
|
382
|
+
|
383
|
+
unwrap(message: Value): string | number | boolean | Object | null | Array<any> | undefined {
|
384
|
+
if (message?.string_value !== undefined) {
|
385
|
+
return message.string_value;
|
386
|
+
} else if (message?.number_value !== undefined) {
|
387
|
+
return message.number_value;
|
388
|
+
} else if (message?.bool_value !== undefined) {
|
389
|
+
return message.bool_value;
|
390
|
+
} else if (message?.struct_value !== undefined) {
|
391
|
+
return message.struct_value;
|
392
|
+
} else if (message?.list_value !== undefined) {
|
393
|
+
return message.list_value;
|
394
|
+
} else if (message?.null_value !== undefined) {
|
395
|
+
return null;
|
396
|
+
}
|
397
|
+
return undefined;
|
398
|
+
},
|
399
|
+
};
|
400
|
+
|
401
|
+
function createBaseListValue(): ListValue {
|
402
|
+
return { values: [] };
|
403
|
+
}
|
404
|
+
|
405
|
+
export const ListValue = {
|
406
|
+
encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
407
|
+
for (const v of message.values) {
|
408
|
+
Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim();
|
409
|
+
}
|
410
|
+
return writer;
|
411
|
+
},
|
412
|
+
|
413
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ListValue {
|
414
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
415
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
416
|
+
const message = createBaseListValue();
|
417
|
+
while (reader.pos < end) {
|
418
|
+
const tag = reader.uint32();
|
419
|
+
switch (tag >>> 3) {
|
420
|
+
case 1:
|
421
|
+
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
422
|
+
break;
|
423
|
+
default:
|
424
|
+
reader.skipType(tag & 7);
|
425
|
+
break;
|
426
|
+
}
|
427
|
+
}
|
428
|
+
return message;
|
429
|
+
},
|
430
|
+
|
431
|
+
fromJSON(object: any): ListValue {
|
432
|
+
return { values: Array.isArray(object?.values) ? [...object.values] : [] };
|
433
|
+
},
|
434
|
+
|
435
|
+
toJSON(message: ListValue): unknown {
|
436
|
+
const obj: any = {};
|
437
|
+
if (message.values) {
|
438
|
+
obj.values = message.values.map((e) => e);
|
439
|
+
} else {
|
440
|
+
obj.values = [];
|
441
|
+
}
|
442
|
+
return obj;
|
443
|
+
},
|
444
|
+
|
445
|
+
create<I extends Exact<DeepPartial<ListValue>, I>>(base?: I): ListValue {
|
446
|
+
return ListValue.fromPartial(base ?? {});
|
447
|
+
},
|
448
|
+
|
449
|
+
fromPartial<I extends Exact<DeepPartial<ListValue>, I>>(object: I): ListValue {
|
450
|
+
const message = createBaseListValue();
|
451
|
+
message.values = object.values?.map((e) => e) || [];
|
452
|
+
return message;
|
453
|
+
},
|
454
|
+
|
455
|
+
wrap(value: Array<any> | undefined): ListValue {
|
456
|
+
const result = createBaseListValue();
|
457
|
+
|
458
|
+
result.values = value ?? [];
|
459
|
+
|
460
|
+
return result;
|
461
|
+
},
|
462
|
+
|
463
|
+
unwrap(message: ListValue): Array<any> {
|
464
|
+
return message.values;
|
465
|
+
},
|
466
|
+
};
|
467
|
+
|
468
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
469
|
+
|
470
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
471
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
472
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
473
|
+
: Partial<T>;
|
474
|
+
|
475
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
476
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
477
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
478
|
+
|
479
|
+
function isObject(value: any): boolean {
|
480
|
+
return typeof value === "object" && value !== null;
|
481
|
+
}
|
482
|
+
|
483
|
+
function isSet(value: any): boolean {
|
484
|
+
return value !== null && value !== undefined;
|
485
|
+
}
|