@control_yourself/contracts 0.3.0 → 0.3.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.
- package/dist/generated/messenger_pb.d.ts +42 -1
- package/dist/generated/messenger_pb.js +15 -2
- package/dist/generated/messenger_pb.js.map +1 -1
- package/dist/generated-grpc/messenger.d.ts +56 -0
- package/dist/generated-grpc/messenger.js +543 -1
- package/dist/generated-grpc/messenger.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/generated/messenger_pb.ts +162 -3
- package/generated-grpc/auth.ts +1 -1
- package/generated-grpc/google/protobuf/empty.ts +1 -1
- package/generated-grpc/messenger.ts +659 -1
- package/package.json +1 -1
- package/protos/messenger.proto +33 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
4
|
// protoc unknown
|
|
5
5
|
// source: messenger.proto
|
|
6
6
|
|
|
@@ -21,6 +21,51 @@ import {
|
|
|
21
21
|
|
|
22
22
|
export const protobufPackage = "messenger.v1";
|
|
23
23
|
|
|
24
|
+
export enum LinkTelegramAccountStatus {
|
|
25
|
+
STATUS_UNSPECIFIED = 0,
|
|
26
|
+
STATUS_COMPLETED = 1,
|
|
27
|
+
STATUS_PROCESSING = 2,
|
|
28
|
+
STATUS_FAILED = 3,
|
|
29
|
+
UNRECOGNIZED = -1,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function linkTelegramAccountStatusFromJSON(object: any): LinkTelegramAccountStatus {
|
|
33
|
+
switch (object) {
|
|
34
|
+
case 0:
|
|
35
|
+
case "STATUS_UNSPECIFIED":
|
|
36
|
+
return LinkTelegramAccountStatus.STATUS_UNSPECIFIED;
|
|
37
|
+
case 1:
|
|
38
|
+
case "STATUS_COMPLETED":
|
|
39
|
+
return LinkTelegramAccountStatus.STATUS_COMPLETED;
|
|
40
|
+
case 2:
|
|
41
|
+
case "STATUS_PROCESSING":
|
|
42
|
+
return LinkTelegramAccountStatus.STATUS_PROCESSING;
|
|
43
|
+
case 3:
|
|
44
|
+
case "STATUS_FAILED":
|
|
45
|
+
return LinkTelegramAccountStatus.STATUS_FAILED;
|
|
46
|
+
case -1:
|
|
47
|
+
case "UNRECOGNIZED":
|
|
48
|
+
default:
|
|
49
|
+
return LinkTelegramAccountStatus.UNRECOGNIZED;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function linkTelegramAccountStatusToJSON(object: LinkTelegramAccountStatus): string {
|
|
54
|
+
switch (object) {
|
|
55
|
+
case LinkTelegramAccountStatus.STATUS_UNSPECIFIED:
|
|
56
|
+
return "STATUS_UNSPECIFIED";
|
|
57
|
+
case LinkTelegramAccountStatus.STATUS_COMPLETED:
|
|
58
|
+
return "STATUS_COMPLETED";
|
|
59
|
+
case LinkTelegramAccountStatus.STATUS_PROCESSING:
|
|
60
|
+
return "STATUS_PROCESSING";
|
|
61
|
+
case LinkTelegramAccountStatus.STATUS_FAILED:
|
|
62
|
+
return "STATUS_FAILED";
|
|
63
|
+
case LinkTelegramAccountStatus.UNRECOGNIZED:
|
|
64
|
+
default:
|
|
65
|
+
return "UNRECOGNIZED";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
24
69
|
export interface GenerateTelegramLinkRequest {
|
|
25
70
|
userId: number;
|
|
26
71
|
}
|
|
@@ -29,6 +74,38 @@ export interface GenerateTelegramLinkResponse {
|
|
|
29
74
|
link: string;
|
|
30
75
|
}
|
|
31
76
|
|
|
77
|
+
export interface LinkTelegramAccountRequestPayload {
|
|
78
|
+
token: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface LinkTelegramAccountResponsePayload {
|
|
82
|
+
status: LinkTelegramAccountStatus;
|
|
83
|
+
message: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface TelegramMeta {
|
|
87
|
+
timestamp: number;
|
|
88
|
+
correlationId: string;
|
|
89
|
+
telegramUserId: number;
|
|
90
|
+
chatId: number;
|
|
91
|
+
headers: { [key: string]: string };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface TelegramMeta_HeadersEntry {
|
|
95
|
+
key: string;
|
|
96
|
+
value: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface LinkTelegramAccountRequest {
|
|
100
|
+
meta: TelegramMeta | undefined;
|
|
101
|
+
payload: LinkTelegramAccountRequestPayload | undefined;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface LinkTelegramAccountResponse {
|
|
105
|
+
meta: TelegramMeta | undefined;
|
|
106
|
+
payload: LinkTelegramAccountResponsePayload | undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
32
109
|
function createBaseGenerateTelegramLinkRequest(): GenerateTelegramLinkRequest {
|
|
33
110
|
return { userId: 0 };
|
|
34
111
|
}
|
|
@@ -151,6 +228,545 @@ export const GenerateTelegramLinkResponse: MessageFns<GenerateTelegramLinkRespon
|
|
|
151
228
|
},
|
|
152
229
|
};
|
|
153
230
|
|
|
231
|
+
function createBaseLinkTelegramAccountRequestPayload(): LinkTelegramAccountRequestPayload {
|
|
232
|
+
return { token: "" };
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export const LinkTelegramAccountRequestPayload: MessageFns<LinkTelegramAccountRequestPayload> = {
|
|
236
|
+
encode(message: LinkTelegramAccountRequestPayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
237
|
+
if (message.token !== "") {
|
|
238
|
+
writer.uint32(10).string(message.token);
|
|
239
|
+
}
|
|
240
|
+
return writer;
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LinkTelegramAccountRequestPayload {
|
|
244
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
245
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
246
|
+
const message = createBaseLinkTelegramAccountRequestPayload();
|
|
247
|
+
while (reader.pos < end) {
|
|
248
|
+
const tag = reader.uint32();
|
|
249
|
+
switch (tag >>> 3) {
|
|
250
|
+
case 1: {
|
|
251
|
+
if (tag !== 10) {
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
message.token = reader.string();
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
reader.skip(tag & 7);
|
|
263
|
+
}
|
|
264
|
+
return message;
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
fromJSON(object: any): LinkTelegramAccountRequestPayload {
|
|
268
|
+
return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
toJSON(message: LinkTelegramAccountRequestPayload): unknown {
|
|
272
|
+
const obj: any = {};
|
|
273
|
+
if (message.token !== "") {
|
|
274
|
+
obj.token = message.token;
|
|
275
|
+
}
|
|
276
|
+
return obj;
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
create<I extends Exact<DeepPartial<LinkTelegramAccountRequestPayload>, I>>(
|
|
280
|
+
base?: I,
|
|
281
|
+
): LinkTelegramAccountRequestPayload {
|
|
282
|
+
return LinkTelegramAccountRequestPayload.fromPartial(base ?? ({} as any));
|
|
283
|
+
},
|
|
284
|
+
fromPartial<I extends Exact<DeepPartial<LinkTelegramAccountRequestPayload>, I>>(
|
|
285
|
+
object: I,
|
|
286
|
+
): LinkTelegramAccountRequestPayload {
|
|
287
|
+
const message = createBaseLinkTelegramAccountRequestPayload();
|
|
288
|
+
message.token = object.token ?? "";
|
|
289
|
+
return message;
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
function createBaseLinkTelegramAccountResponsePayload(): LinkTelegramAccountResponsePayload {
|
|
294
|
+
return { status: 0, message: "" };
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export const LinkTelegramAccountResponsePayload: MessageFns<LinkTelegramAccountResponsePayload> = {
|
|
298
|
+
encode(message: LinkTelegramAccountResponsePayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
299
|
+
if (message.status !== 0) {
|
|
300
|
+
writer.uint32(8).int32(message.status);
|
|
301
|
+
}
|
|
302
|
+
if (message.message !== "") {
|
|
303
|
+
writer.uint32(18).string(message.message);
|
|
304
|
+
}
|
|
305
|
+
return writer;
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LinkTelegramAccountResponsePayload {
|
|
309
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
310
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
311
|
+
const message = createBaseLinkTelegramAccountResponsePayload();
|
|
312
|
+
while (reader.pos < end) {
|
|
313
|
+
const tag = reader.uint32();
|
|
314
|
+
switch (tag >>> 3) {
|
|
315
|
+
case 1: {
|
|
316
|
+
if (tag !== 8) {
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
message.status = reader.int32() as any;
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
case 2: {
|
|
324
|
+
if (tag !== 18) {
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
message.message = reader.string();
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
reader.skip(tag & 7);
|
|
336
|
+
}
|
|
337
|
+
return message;
|
|
338
|
+
},
|
|
339
|
+
|
|
340
|
+
fromJSON(object: any): LinkTelegramAccountResponsePayload {
|
|
341
|
+
return {
|
|
342
|
+
status: isSet(object.status) ? linkTelegramAccountStatusFromJSON(object.status) : 0,
|
|
343
|
+
message: isSet(object.message) ? globalThis.String(object.message) : "",
|
|
344
|
+
};
|
|
345
|
+
},
|
|
346
|
+
|
|
347
|
+
toJSON(message: LinkTelegramAccountResponsePayload): unknown {
|
|
348
|
+
const obj: any = {};
|
|
349
|
+
if (message.status !== 0) {
|
|
350
|
+
obj.status = linkTelegramAccountStatusToJSON(message.status);
|
|
351
|
+
}
|
|
352
|
+
if (message.message !== "") {
|
|
353
|
+
obj.message = message.message;
|
|
354
|
+
}
|
|
355
|
+
return obj;
|
|
356
|
+
},
|
|
357
|
+
|
|
358
|
+
create<I extends Exact<DeepPartial<LinkTelegramAccountResponsePayload>, I>>(
|
|
359
|
+
base?: I,
|
|
360
|
+
): LinkTelegramAccountResponsePayload {
|
|
361
|
+
return LinkTelegramAccountResponsePayload.fromPartial(base ?? ({} as any));
|
|
362
|
+
},
|
|
363
|
+
fromPartial<I extends Exact<DeepPartial<LinkTelegramAccountResponsePayload>, I>>(
|
|
364
|
+
object: I,
|
|
365
|
+
): LinkTelegramAccountResponsePayload {
|
|
366
|
+
const message = createBaseLinkTelegramAccountResponsePayload();
|
|
367
|
+
message.status = object.status ?? 0;
|
|
368
|
+
message.message = object.message ?? "";
|
|
369
|
+
return message;
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
function createBaseTelegramMeta(): TelegramMeta {
|
|
374
|
+
return { timestamp: 0, correlationId: "", telegramUserId: 0, chatId: 0, headers: {} };
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export const TelegramMeta: MessageFns<TelegramMeta> = {
|
|
378
|
+
encode(message: TelegramMeta, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
379
|
+
if (message.timestamp !== 0) {
|
|
380
|
+
writer.uint32(8).int64(message.timestamp);
|
|
381
|
+
}
|
|
382
|
+
if (message.correlationId !== "") {
|
|
383
|
+
writer.uint32(18).string(message.correlationId);
|
|
384
|
+
}
|
|
385
|
+
if (message.telegramUserId !== 0) {
|
|
386
|
+
writer.uint32(24).int64(message.telegramUserId);
|
|
387
|
+
}
|
|
388
|
+
if (message.chatId !== 0) {
|
|
389
|
+
writer.uint32(32).int64(message.chatId);
|
|
390
|
+
}
|
|
391
|
+
globalThis.Object.entries(message.headers).forEach(([key, value]: [string, string]) => {
|
|
392
|
+
TelegramMeta_HeadersEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join();
|
|
393
|
+
});
|
|
394
|
+
return writer;
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramMeta {
|
|
398
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
399
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
400
|
+
const message = createBaseTelegramMeta();
|
|
401
|
+
while (reader.pos < end) {
|
|
402
|
+
const tag = reader.uint32();
|
|
403
|
+
switch (tag >>> 3) {
|
|
404
|
+
case 1: {
|
|
405
|
+
if (tag !== 8) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
message.timestamp = longToNumber(reader.int64());
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
case 2: {
|
|
413
|
+
if (tag !== 18) {
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
message.correlationId = reader.string();
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
case 3: {
|
|
421
|
+
if (tag !== 24) {
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
message.telegramUserId = longToNumber(reader.int64());
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
case 4: {
|
|
429
|
+
if (tag !== 32) {
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
message.chatId = longToNumber(reader.int64());
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
case 5: {
|
|
437
|
+
if (tag !== 42) {
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const entry5 = TelegramMeta_HeadersEntry.decode(reader, reader.uint32());
|
|
442
|
+
if (entry5.value !== undefined) {
|
|
443
|
+
message.headers[entry5.key] = entry5.value;
|
|
444
|
+
}
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
reader.skip(tag & 7);
|
|
452
|
+
}
|
|
453
|
+
return message;
|
|
454
|
+
},
|
|
455
|
+
|
|
456
|
+
fromJSON(object: any): TelegramMeta {
|
|
457
|
+
return {
|
|
458
|
+
timestamp: isSet(object.timestamp) ? globalThis.Number(object.timestamp) : 0,
|
|
459
|
+
correlationId: isSet(object.correlationId)
|
|
460
|
+
? globalThis.String(object.correlationId)
|
|
461
|
+
: isSet(object.correlation_id)
|
|
462
|
+
? globalThis.String(object.correlation_id)
|
|
463
|
+
: "",
|
|
464
|
+
telegramUserId: isSet(object.telegramUserId)
|
|
465
|
+
? globalThis.Number(object.telegramUserId)
|
|
466
|
+
: isSet(object.telegram_user_id)
|
|
467
|
+
? globalThis.Number(object.telegram_user_id)
|
|
468
|
+
: 0,
|
|
469
|
+
chatId: isSet(object.chatId)
|
|
470
|
+
? globalThis.Number(object.chatId)
|
|
471
|
+
: isSet(object.chat_id)
|
|
472
|
+
? globalThis.Number(object.chat_id)
|
|
473
|
+
: 0,
|
|
474
|
+
headers: isObject(object.headers)
|
|
475
|
+
? (globalThis.Object.entries(object.headers) as [string, any][]).reduce(
|
|
476
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
477
|
+
acc[key] = globalThis.String(value);
|
|
478
|
+
return acc;
|
|
479
|
+
},
|
|
480
|
+
{},
|
|
481
|
+
)
|
|
482
|
+
: {},
|
|
483
|
+
};
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
toJSON(message: TelegramMeta): unknown {
|
|
487
|
+
const obj: any = {};
|
|
488
|
+
if (message.timestamp !== 0) {
|
|
489
|
+
obj.timestamp = Math.round(message.timestamp);
|
|
490
|
+
}
|
|
491
|
+
if (message.correlationId !== "") {
|
|
492
|
+
obj.correlationId = message.correlationId;
|
|
493
|
+
}
|
|
494
|
+
if (message.telegramUserId !== 0) {
|
|
495
|
+
obj.telegramUserId = Math.round(message.telegramUserId);
|
|
496
|
+
}
|
|
497
|
+
if (message.chatId !== 0) {
|
|
498
|
+
obj.chatId = Math.round(message.chatId);
|
|
499
|
+
}
|
|
500
|
+
if (message.headers) {
|
|
501
|
+
const entries = globalThis.Object.entries(message.headers) as [string, string][];
|
|
502
|
+
if (entries.length > 0) {
|
|
503
|
+
obj.headers = {};
|
|
504
|
+
entries.forEach(([k, v]) => {
|
|
505
|
+
obj.headers[k] = v;
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return obj;
|
|
510
|
+
},
|
|
511
|
+
|
|
512
|
+
create<I extends Exact<DeepPartial<TelegramMeta>, I>>(base?: I): TelegramMeta {
|
|
513
|
+
return TelegramMeta.fromPartial(base ?? ({} as any));
|
|
514
|
+
},
|
|
515
|
+
fromPartial<I extends Exact<DeepPartial<TelegramMeta>, I>>(object: I): TelegramMeta {
|
|
516
|
+
const message = createBaseTelegramMeta();
|
|
517
|
+
message.timestamp = object.timestamp ?? 0;
|
|
518
|
+
message.correlationId = object.correlationId ?? "";
|
|
519
|
+
message.telegramUserId = object.telegramUserId ?? 0;
|
|
520
|
+
message.chatId = object.chatId ?? 0;
|
|
521
|
+
message.headers = (globalThis.Object.entries(object.headers ?? {}) as [string, string][]).reduce(
|
|
522
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
523
|
+
if (value !== undefined) {
|
|
524
|
+
acc[key] = globalThis.String(value);
|
|
525
|
+
}
|
|
526
|
+
return acc;
|
|
527
|
+
},
|
|
528
|
+
{},
|
|
529
|
+
);
|
|
530
|
+
return message;
|
|
531
|
+
},
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
function createBaseTelegramMeta_HeadersEntry(): TelegramMeta_HeadersEntry {
|
|
535
|
+
return { key: "", value: "" };
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export const TelegramMeta_HeadersEntry: MessageFns<TelegramMeta_HeadersEntry> = {
|
|
539
|
+
encode(message: TelegramMeta_HeadersEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
540
|
+
if (message.key !== "") {
|
|
541
|
+
writer.uint32(10).string(message.key);
|
|
542
|
+
}
|
|
543
|
+
if (message.value !== "") {
|
|
544
|
+
writer.uint32(18).string(message.value);
|
|
545
|
+
}
|
|
546
|
+
return writer;
|
|
547
|
+
},
|
|
548
|
+
|
|
549
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramMeta_HeadersEntry {
|
|
550
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
551
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
552
|
+
const message = createBaseTelegramMeta_HeadersEntry();
|
|
553
|
+
while (reader.pos < end) {
|
|
554
|
+
const tag = reader.uint32();
|
|
555
|
+
switch (tag >>> 3) {
|
|
556
|
+
case 1: {
|
|
557
|
+
if (tag !== 10) {
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
message.key = reader.string();
|
|
562
|
+
continue;
|
|
563
|
+
}
|
|
564
|
+
case 2: {
|
|
565
|
+
if (tag !== 18) {
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
message.value = reader.string();
|
|
570
|
+
continue;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
reader.skip(tag & 7);
|
|
577
|
+
}
|
|
578
|
+
return message;
|
|
579
|
+
},
|
|
580
|
+
|
|
581
|
+
fromJSON(object: any): TelegramMeta_HeadersEntry {
|
|
582
|
+
return {
|
|
583
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
584
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
585
|
+
};
|
|
586
|
+
},
|
|
587
|
+
|
|
588
|
+
toJSON(message: TelegramMeta_HeadersEntry): unknown {
|
|
589
|
+
const obj: any = {};
|
|
590
|
+
if (message.key !== "") {
|
|
591
|
+
obj.key = message.key;
|
|
592
|
+
}
|
|
593
|
+
if (message.value !== "") {
|
|
594
|
+
obj.value = message.value;
|
|
595
|
+
}
|
|
596
|
+
return obj;
|
|
597
|
+
},
|
|
598
|
+
|
|
599
|
+
create<I extends Exact<DeepPartial<TelegramMeta_HeadersEntry>, I>>(base?: I): TelegramMeta_HeadersEntry {
|
|
600
|
+
return TelegramMeta_HeadersEntry.fromPartial(base ?? ({} as any));
|
|
601
|
+
},
|
|
602
|
+
fromPartial<I extends Exact<DeepPartial<TelegramMeta_HeadersEntry>, I>>(object: I): TelegramMeta_HeadersEntry {
|
|
603
|
+
const message = createBaseTelegramMeta_HeadersEntry();
|
|
604
|
+
message.key = object.key ?? "";
|
|
605
|
+
message.value = object.value ?? "";
|
|
606
|
+
return message;
|
|
607
|
+
},
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
function createBaseLinkTelegramAccountRequest(): LinkTelegramAccountRequest {
|
|
611
|
+
return { meta: undefined, payload: undefined };
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
export const LinkTelegramAccountRequest: MessageFns<LinkTelegramAccountRequest> = {
|
|
615
|
+
encode(message: LinkTelegramAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
616
|
+
if (message.meta !== undefined) {
|
|
617
|
+
TelegramMeta.encode(message.meta, writer.uint32(10).fork()).join();
|
|
618
|
+
}
|
|
619
|
+
if (message.payload !== undefined) {
|
|
620
|
+
LinkTelegramAccountRequestPayload.encode(message.payload, writer.uint32(18).fork()).join();
|
|
621
|
+
}
|
|
622
|
+
return writer;
|
|
623
|
+
},
|
|
624
|
+
|
|
625
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LinkTelegramAccountRequest {
|
|
626
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
627
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
628
|
+
const message = createBaseLinkTelegramAccountRequest();
|
|
629
|
+
while (reader.pos < end) {
|
|
630
|
+
const tag = reader.uint32();
|
|
631
|
+
switch (tag >>> 3) {
|
|
632
|
+
case 1: {
|
|
633
|
+
if (tag !== 10) {
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
message.meta = TelegramMeta.decode(reader, reader.uint32());
|
|
638
|
+
continue;
|
|
639
|
+
}
|
|
640
|
+
case 2: {
|
|
641
|
+
if (tag !== 18) {
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
message.payload = LinkTelegramAccountRequestPayload.decode(reader, reader.uint32());
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
652
|
+
reader.skip(tag & 7);
|
|
653
|
+
}
|
|
654
|
+
return message;
|
|
655
|
+
},
|
|
656
|
+
|
|
657
|
+
fromJSON(object: any): LinkTelegramAccountRequest {
|
|
658
|
+
return {
|
|
659
|
+
meta: isSet(object.meta) ? TelegramMeta.fromJSON(object.meta) : undefined,
|
|
660
|
+
payload: isSet(object.payload) ? LinkTelegramAccountRequestPayload.fromJSON(object.payload) : undefined,
|
|
661
|
+
};
|
|
662
|
+
},
|
|
663
|
+
|
|
664
|
+
toJSON(message: LinkTelegramAccountRequest): unknown {
|
|
665
|
+
const obj: any = {};
|
|
666
|
+
if (message.meta !== undefined) {
|
|
667
|
+
obj.meta = TelegramMeta.toJSON(message.meta);
|
|
668
|
+
}
|
|
669
|
+
if (message.payload !== undefined) {
|
|
670
|
+
obj.payload = LinkTelegramAccountRequestPayload.toJSON(message.payload);
|
|
671
|
+
}
|
|
672
|
+
return obj;
|
|
673
|
+
},
|
|
674
|
+
|
|
675
|
+
create<I extends Exact<DeepPartial<LinkTelegramAccountRequest>, I>>(base?: I): LinkTelegramAccountRequest {
|
|
676
|
+
return LinkTelegramAccountRequest.fromPartial(base ?? ({} as any));
|
|
677
|
+
},
|
|
678
|
+
fromPartial<I extends Exact<DeepPartial<LinkTelegramAccountRequest>, I>>(object: I): LinkTelegramAccountRequest {
|
|
679
|
+
const message = createBaseLinkTelegramAccountRequest();
|
|
680
|
+
message.meta = (object.meta !== undefined && object.meta !== null)
|
|
681
|
+
? TelegramMeta.fromPartial(object.meta)
|
|
682
|
+
: undefined;
|
|
683
|
+
message.payload = (object.payload !== undefined && object.payload !== null)
|
|
684
|
+
? LinkTelegramAccountRequestPayload.fromPartial(object.payload)
|
|
685
|
+
: undefined;
|
|
686
|
+
return message;
|
|
687
|
+
},
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
function createBaseLinkTelegramAccountResponse(): LinkTelegramAccountResponse {
|
|
691
|
+
return { meta: undefined, payload: undefined };
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export const LinkTelegramAccountResponse: MessageFns<LinkTelegramAccountResponse> = {
|
|
695
|
+
encode(message: LinkTelegramAccountResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
696
|
+
if (message.meta !== undefined) {
|
|
697
|
+
TelegramMeta.encode(message.meta, writer.uint32(10).fork()).join();
|
|
698
|
+
}
|
|
699
|
+
if (message.payload !== undefined) {
|
|
700
|
+
LinkTelegramAccountResponsePayload.encode(message.payload, writer.uint32(18).fork()).join();
|
|
701
|
+
}
|
|
702
|
+
return writer;
|
|
703
|
+
},
|
|
704
|
+
|
|
705
|
+
decode(input: BinaryReader | Uint8Array, length?: number): LinkTelegramAccountResponse {
|
|
706
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
707
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
708
|
+
const message = createBaseLinkTelegramAccountResponse();
|
|
709
|
+
while (reader.pos < end) {
|
|
710
|
+
const tag = reader.uint32();
|
|
711
|
+
switch (tag >>> 3) {
|
|
712
|
+
case 1: {
|
|
713
|
+
if (tag !== 10) {
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
message.meta = TelegramMeta.decode(reader, reader.uint32());
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
case 2: {
|
|
721
|
+
if (tag !== 18) {
|
|
722
|
+
break;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
message.payload = LinkTelegramAccountResponsePayload.decode(reader, reader.uint32());
|
|
726
|
+
continue;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
730
|
+
break;
|
|
731
|
+
}
|
|
732
|
+
reader.skip(tag & 7);
|
|
733
|
+
}
|
|
734
|
+
return message;
|
|
735
|
+
},
|
|
736
|
+
|
|
737
|
+
fromJSON(object: any): LinkTelegramAccountResponse {
|
|
738
|
+
return {
|
|
739
|
+
meta: isSet(object.meta) ? TelegramMeta.fromJSON(object.meta) : undefined,
|
|
740
|
+
payload: isSet(object.payload) ? LinkTelegramAccountResponsePayload.fromJSON(object.payload) : undefined,
|
|
741
|
+
};
|
|
742
|
+
},
|
|
743
|
+
|
|
744
|
+
toJSON(message: LinkTelegramAccountResponse): unknown {
|
|
745
|
+
const obj: any = {};
|
|
746
|
+
if (message.meta !== undefined) {
|
|
747
|
+
obj.meta = TelegramMeta.toJSON(message.meta);
|
|
748
|
+
}
|
|
749
|
+
if (message.payload !== undefined) {
|
|
750
|
+
obj.payload = LinkTelegramAccountResponsePayload.toJSON(message.payload);
|
|
751
|
+
}
|
|
752
|
+
return obj;
|
|
753
|
+
},
|
|
754
|
+
|
|
755
|
+
create<I extends Exact<DeepPartial<LinkTelegramAccountResponse>, I>>(base?: I): LinkTelegramAccountResponse {
|
|
756
|
+
return LinkTelegramAccountResponse.fromPartial(base ?? ({} as any));
|
|
757
|
+
},
|
|
758
|
+
fromPartial<I extends Exact<DeepPartial<LinkTelegramAccountResponse>, I>>(object: I): LinkTelegramAccountResponse {
|
|
759
|
+
const message = createBaseLinkTelegramAccountResponse();
|
|
760
|
+
message.meta = (object.meta !== undefined && object.meta !== null)
|
|
761
|
+
? TelegramMeta.fromPartial(object.meta)
|
|
762
|
+
: undefined;
|
|
763
|
+
message.payload = (object.payload !== undefined && object.payload !== null)
|
|
764
|
+
? LinkTelegramAccountResponsePayload.fromPartial(object.payload)
|
|
765
|
+
: undefined;
|
|
766
|
+
return message;
|
|
767
|
+
},
|
|
768
|
+
};
|
|
769
|
+
|
|
154
770
|
export type MessengerServiceService = typeof MessengerServiceService;
|
|
155
771
|
export const MessengerServiceService = {
|
|
156
772
|
generateTelegramLink: {
|
|
@@ -164,10 +780,22 @@ export const MessengerServiceService = {
|
|
|
164
780
|
Buffer.from(GenerateTelegramLinkResponse.encode(value).finish()),
|
|
165
781
|
responseDeserialize: (value: Buffer): GenerateTelegramLinkResponse => GenerateTelegramLinkResponse.decode(value),
|
|
166
782
|
},
|
|
783
|
+
linkTelegramAccount: {
|
|
784
|
+
path: "/messenger.v1.MessengerService/LinkTelegramAccount",
|
|
785
|
+
requestStream: false,
|
|
786
|
+
responseStream: false,
|
|
787
|
+
requestSerialize: (value: LinkTelegramAccountRequest): Buffer =>
|
|
788
|
+
Buffer.from(LinkTelegramAccountRequest.encode(value).finish()),
|
|
789
|
+
requestDeserialize: (value: Buffer): LinkTelegramAccountRequest => LinkTelegramAccountRequest.decode(value),
|
|
790
|
+
responseSerialize: (value: LinkTelegramAccountResponse): Buffer =>
|
|
791
|
+
Buffer.from(LinkTelegramAccountResponse.encode(value).finish()),
|
|
792
|
+
responseDeserialize: (value: Buffer): LinkTelegramAccountResponse => LinkTelegramAccountResponse.decode(value),
|
|
793
|
+
},
|
|
167
794
|
} as const;
|
|
168
795
|
|
|
169
796
|
export interface MessengerServiceServer extends UntypedServiceImplementation {
|
|
170
797
|
generateTelegramLink: handleUnaryCall<GenerateTelegramLinkRequest, GenerateTelegramLinkResponse>;
|
|
798
|
+
linkTelegramAccount: handleUnaryCall<LinkTelegramAccountRequest, LinkTelegramAccountResponse>;
|
|
171
799
|
}
|
|
172
800
|
|
|
173
801
|
export interface MessengerServiceClient extends Client {
|
|
@@ -186,6 +814,21 @@ export interface MessengerServiceClient extends Client {
|
|
|
186
814
|
options: Partial<CallOptions>,
|
|
187
815
|
callback: (error: ServiceError | null, response: GenerateTelegramLinkResponse) => void,
|
|
188
816
|
): ClientUnaryCall;
|
|
817
|
+
linkTelegramAccount(
|
|
818
|
+
request: LinkTelegramAccountRequest,
|
|
819
|
+
callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void,
|
|
820
|
+
): ClientUnaryCall;
|
|
821
|
+
linkTelegramAccount(
|
|
822
|
+
request: LinkTelegramAccountRequest,
|
|
823
|
+
metadata: Metadata,
|
|
824
|
+
callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void,
|
|
825
|
+
): ClientUnaryCall;
|
|
826
|
+
linkTelegramAccount(
|
|
827
|
+
request: LinkTelegramAccountRequest,
|
|
828
|
+
metadata: Metadata,
|
|
829
|
+
options: Partial<CallOptions>,
|
|
830
|
+
callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void,
|
|
831
|
+
): ClientUnaryCall;
|
|
189
832
|
}
|
|
190
833
|
|
|
191
834
|
export const MessengerServiceClient = makeGenericClientConstructor(
|
|
@@ -209,6 +852,21 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
|
209
852
|
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
210
853
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
211
854
|
|
|
855
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
856
|
+
const num = globalThis.Number(int64.toString());
|
|
857
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
858
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
859
|
+
}
|
|
860
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
861
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
862
|
+
}
|
|
863
|
+
return num;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
function isObject(value: any): boolean {
|
|
867
|
+
return typeof value === "object" && value !== null;
|
|
868
|
+
}
|
|
869
|
+
|
|
212
870
|
function isSet(value: any): boolean {
|
|
213
871
|
return value !== null && value !== undefined;
|
|
214
872
|
}
|