@control_yourself/contracts 0.3.1 → 0.3.3

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.
@@ -1,4 +1,5 @@
1
1
  import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { EmptySchema } from "@bufbuild/protobuf/wkt";
2
3
  import type { Message } from "@bufbuild/protobuf";
3
4
  export declare const file_messenger: GenFile;
4
5
  export type GenerateTelegramLinkRequest = Message<"messenger.v1.GenerateTelegramLinkRequest"> & {
@@ -38,6 +39,32 @@ export type LinkTelegramAccountResponse = Message<"messenger.v1.LinkTelegramAcco
38
39
  payload?: LinkTelegramAccountResponsePayload;
39
40
  };
40
41
  export declare const LinkTelegramAccountResponseSchema: GenMessage<LinkTelegramAccountResponse>;
42
+ export type GetIntegrationsRequest = Message<"messenger.v1.GetIntegrationsRequest"> & {
43
+ userId: number;
44
+ };
45
+ export declare const GetIntegrationsRequestSchema: GenMessage<GetIntegrationsRequest>;
46
+ export type Integration = Message<"messenger.v1.Integration"> & {
47
+ id: number;
48
+ meta: {
49
+ [key: string]: string;
50
+ };
51
+ messenger: string;
52
+ messengerId: string;
53
+ userId: number;
54
+ createdAt: number;
55
+ updatedAt: number;
56
+ deletedAt: number;
57
+ };
58
+ export declare const IntegrationSchema: GenMessage<Integration>;
59
+ export type GetIntegrationsResponse = Message<"messenger.v1.GetIntegrationsResponse"> & {
60
+ integrations: Integration[];
61
+ };
62
+ export declare const GetIntegrationsResponseSchema: GenMessage<GetIntegrationsResponse>;
63
+ export type RemoveIntegrationRequest = Message<"messenger.v1.RemoveIntegrationRequest"> & {
64
+ integrationId: number;
65
+ userId: number;
66
+ };
67
+ export declare const RemoveIntegrationRequestSchema: GenMessage<RemoveIntegrationRequest>;
41
68
  export declare enum LinkTelegramAccountStatus {
42
69
  STATUS_UNSPECIFIED = 0,
43
70
  STATUS_COMPLETED = 1,
@@ -56,4 +83,14 @@ export declare const MessengerService: GenService<{
56
83
  input: typeof LinkTelegramAccountRequestSchema;
57
84
  output: typeof LinkTelegramAccountResponseSchema;
58
85
  };
86
+ getIntegrations: {
87
+ methodKind: "unary";
88
+ input: typeof GetIntegrationsRequestSchema;
89
+ output: typeof GetIntegrationsResponseSchema;
90
+ };
91
+ removeIntegration: {
92
+ methodKind: "unary";
93
+ input: typeof RemoveIntegrationRequestSchema;
94
+ output: typeof EmptySchema;
95
+ };
59
96
  }>;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessengerService = exports.LinkTelegramAccountStatusSchema = exports.LinkTelegramAccountStatus = exports.LinkTelegramAccountResponseSchema = exports.LinkTelegramAccountRequestSchema = exports.TelegramMetaSchema = exports.LinkTelegramAccountResponsePayloadSchema = exports.LinkTelegramAccountRequestPayloadSchema = exports.GenerateTelegramLinkResponseSchema = exports.GenerateTelegramLinkRequestSchema = exports.file_messenger = void 0;
3
+ exports.MessengerService = exports.LinkTelegramAccountStatusSchema = exports.LinkTelegramAccountStatus = exports.RemoveIntegrationRequestSchema = exports.GetIntegrationsResponseSchema = exports.IntegrationSchema = exports.GetIntegrationsRequestSchema = exports.LinkTelegramAccountResponseSchema = exports.LinkTelegramAccountRequestSchema = exports.TelegramMetaSchema = exports.LinkTelegramAccountResponsePayloadSchema = exports.LinkTelegramAccountRequestPayloadSchema = exports.GenerateTelegramLinkResponseSchema = exports.GenerateTelegramLinkRequestSchema = exports.file_messenger = void 0;
4
4
  const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
5
- exports.file_messenger = (0, codegenv2_1.fileDesc)("Cg9tZXNzZW5nZXIucHJvdG8SDG1lc3Nlbmdlci52MSIuChtHZW5lcmF0ZVRlbGVncmFtTGlua1JlcXVlc3QSDwoHdXNlcl9pZBgBIAEoBSIsChxHZW5lcmF0ZVRlbGVncmFtTGlua1Jlc3BvbnNlEgwKBGxpbmsYASABKAkiMgohTGlua1RlbGVncmFt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WxlZ3JhbUxpbmsSKS5tZXNzZW5nZXIudjEuR2VuZXJhdGVUZWxlZ3JhbUxpbmtSZXF1ZXN0GioubWVzc2VuZ2VyLnYxLkdlbmVyYXRlVGVsZWdyYW1MaW5rUmVzcG9uc2USagoTTGlua1RlbGVncmFtQWNjb3VudBIoLm1lc3Nlbmdlci52MS5MaW5rVGVsZWdyYW1BY2NvdW50UmVxdWVzdBopLm1lc3Nlbmdlci52MS5MaW5rVGVsZWdyYW1BY2NvdW50UmVzcG9uc2USXgoPR2V0SW50ZWdyYXRpb25zEiQubWVzc2VuZ2VyLnYxLkdldEludGVncmF0aW9uc1JlcXVlc3QaJS5tZXNzZW5nZXIudjEuR2V0SW50ZWdyYXRpb25zUmVzcG9uc2USUwoRUmVtb3ZlSW50ZWdyYXRpb24SJi5tZXNzZW5nZXIudjEuUmVtb3ZlSW50ZWdyYXRpb25SZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5YgZwcm90bzM", [wkt_1.file_google_protobuf_empty]);
6
7
  exports.GenerateTelegramLinkRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 0);
7
8
  exports.GenerateTelegramLinkResponseSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 1);
8
9
  exports.LinkTelegramAccountRequestPayloadSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 2);
@@ -10,6 +11,10 @@ exports.LinkTelegramAccountResponsePayloadSchema = (0, codegenv2_1.messageDesc)(
10
11
  exports.TelegramMetaSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 4);
11
12
  exports.LinkTelegramAccountRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 5);
12
13
  exports.LinkTelegramAccountResponseSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 6);
14
+ exports.GetIntegrationsRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 7);
15
+ exports.IntegrationSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 8);
16
+ exports.GetIntegrationsResponseSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 9);
17
+ exports.RemoveIntegrationRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_messenger, 10);
13
18
  var LinkTelegramAccountStatus;
14
19
  (function (LinkTelegramAccountStatus) {
15
20
  LinkTelegramAccountStatus[LinkTelegramAccountStatus["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED";
@@ -1 +1 @@
1
- {"version":3,"file":"messenger_pb.js","sourceRoot":"/","sources":["generated/messenger_pb.ts"],"names":[],"mappings":";;;AAKA,4DAA4F;AAM/E,QAAA,cAAc,GACzB,IAAA,oBAAQ,EAAC,s/CAAs/C,CAAC,CAAC;AAgBt/C,QAAA,iCAAiC,GAC5C,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAgBpB,QAAA,kCAAkC,GAC7C,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAgBpB,QAAA,uCAAuC,GAClD,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAqBpB,QAAA,wCAAwC,GACnD,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAoCpB,QAAA,kBAAkB,GAC7B,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAqBpB,QAAA,gCAAgC,GAC3C,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAqBpB,QAAA,iCAAiC,GAC5C,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAKjC,IAAY,yBAoBX;AApBD,WAAY,yBAAyB;IAInC,qGAAsB,CAAA;IAKtB,iGAAoB,CAAA;IAKpB,mGAAqB,CAAA;IAKrB,2FAAiB,CAAA;AACnB,CAAC,EApBW,yBAAyB,yCAAzB,yBAAyB,QAoBpC;AAKY,QAAA,+BAA+B,GAC1C,IAAA,oBAAQ,EAAC,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yBAAyB;IAInC,qGAAsB,CAAA;IAKtB,iGAAoB,CAAA;IAKpB,mGAAqB,CAAA;IAKrB,2FAAiB,CAAA;AACnB,CAAC,EApBW,yBAAyB,yCAAzB,yBAAyB,QAoBpC;AAKY,QAAA,+BAA+B,GAC1C,IAAA,oBAAQ,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC;AAKjB,QAAA,gBAAgB,GAkC3B,IAAA,uBAAW,EAAC,sBAAc,EAAE,CAAC,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
2
  import { type CallOptions, type ChannelCredentials, Client, type ClientOptions, type ClientUnaryCall, type handleUnaryCall, type Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
3
+ import { Empty } from "./google/protobuf/empty";
3
4
  export declare const protobufPackage = "messenger.v1";
4
5
  export declare enum LinkTelegramAccountStatus {
5
6
  STATUS_UNSPECIFIED = 0,
@@ -44,6 +45,32 @@ export interface LinkTelegramAccountResponse {
44
45
  meta: TelegramMeta | undefined;
45
46
  payload: LinkTelegramAccountResponsePayload | undefined;
46
47
  }
48
+ export interface GetIntegrationsRequest {
49
+ userId: number;
50
+ }
51
+ export interface Integration {
52
+ id: number;
53
+ meta: {
54
+ [key: string]: string;
55
+ };
56
+ messenger: string;
57
+ messengerId: string;
58
+ userId: number;
59
+ createdAt: number;
60
+ updatedAt: number;
61
+ deletedAt: number;
62
+ }
63
+ export interface Integration_MetaEntry {
64
+ key: string;
65
+ value: string;
66
+ }
67
+ export interface GetIntegrationsResponse {
68
+ integrations: Integration[];
69
+ }
70
+ export interface RemoveIntegrationRequest {
71
+ integrationId: number;
72
+ userId: number;
73
+ }
47
74
  export declare const GenerateTelegramLinkRequest: MessageFns<GenerateTelegramLinkRequest>;
48
75
  export declare const GenerateTelegramLinkResponse: MessageFns<GenerateTelegramLinkResponse>;
49
76
  export declare const LinkTelegramAccountRequestPayload: MessageFns<LinkTelegramAccountRequestPayload>;
@@ -52,6 +79,11 @@ export declare const TelegramMeta: MessageFns<TelegramMeta>;
52
79
  export declare const TelegramMeta_HeadersEntry: MessageFns<TelegramMeta_HeadersEntry>;
53
80
  export declare const LinkTelegramAccountRequest: MessageFns<LinkTelegramAccountRequest>;
54
81
  export declare const LinkTelegramAccountResponse: MessageFns<LinkTelegramAccountResponse>;
82
+ export declare const GetIntegrationsRequest: MessageFns<GetIntegrationsRequest>;
83
+ export declare const Integration: MessageFns<Integration>;
84
+ export declare const Integration_MetaEntry: MessageFns<Integration_MetaEntry>;
85
+ export declare const GetIntegrationsResponse: MessageFns<GetIntegrationsResponse>;
86
+ export declare const RemoveIntegrationRequest: MessageFns<RemoveIntegrationRequest>;
55
87
  export type MessengerServiceService = typeof MessengerServiceService;
56
88
  export declare const MessengerServiceService: {
57
89
  readonly generateTelegramLink: {
@@ -72,10 +104,30 @@ export declare const MessengerServiceService: {
72
104
  readonly responseSerialize: (value: LinkTelegramAccountResponse) => Buffer;
73
105
  readonly responseDeserialize: (value: Buffer) => LinkTelegramAccountResponse;
74
106
  };
107
+ readonly getIntegrations: {
108
+ readonly path: "/messenger.v1.MessengerService/GetIntegrations";
109
+ readonly requestStream: false;
110
+ readonly responseStream: false;
111
+ readonly requestSerialize: (value: GetIntegrationsRequest) => Buffer;
112
+ readonly requestDeserialize: (value: Buffer) => GetIntegrationsRequest;
113
+ readonly responseSerialize: (value: GetIntegrationsResponse) => Buffer;
114
+ readonly responseDeserialize: (value: Buffer) => GetIntegrationsResponse;
115
+ };
116
+ readonly removeIntegration: {
117
+ readonly path: "/messenger.v1.MessengerService/RemoveIntegration";
118
+ readonly requestStream: false;
119
+ readonly responseStream: false;
120
+ readonly requestSerialize: (value: RemoveIntegrationRequest) => Buffer;
121
+ readonly requestDeserialize: (value: Buffer) => RemoveIntegrationRequest;
122
+ readonly responseSerialize: (value: Empty) => Buffer;
123
+ readonly responseDeserialize: (value: Buffer) => Empty;
124
+ };
75
125
  };
76
126
  export interface MessengerServiceServer extends UntypedServiceImplementation {
77
127
  generateTelegramLink: handleUnaryCall<GenerateTelegramLinkRequest, GenerateTelegramLinkResponse>;
78
128
  linkTelegramAccount: handleUnaryCall<LinkTelegramAccountRequest, LinkTelegramAccountResponse>;
129
+ getIntegrations: handleUnaryCall<GetIntegrationsRequest, GetIntegrationsResponse>;
130
+ removeIntegration: handleUnaryCall<RemoveIntegrationRequest, Empty>;
79
131
  }
80
132
  export interface MessengerServiceClient extends Client {
81
133
  generateTelegramLink(request: GenerateTelegramLinkRequest, callback: (error: ServiceError | null, response: GenerateTelegramLinkResponse) => void): ClientUnaryCall;
@@ -84,6 +136,12 @@ export interface MessengerServiceClient extends Client {
84
136
  linkTelegramAccount(request: LinkTelegramAccountRequest, callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void): ClientUnaryCall;
85
137
  linkTelegramAccount(request: LinkTelegramAccountRequest, metadata: Metadata, callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void): ClientUnaryCall;
86
138
  linkTelegramAccount(request: LinkTelegramAccountRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void): ClientUnaryCall;
139
+ getIntegrations(request: GetIntegrationsRequest, callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void): ClientUnaryCall;
140
+ getIntegrations(request: GetIntegrationsRequest, metadata: Metadata, callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void): ClientUnaryCall;
141
+ getIntegrations(request: GetIntegrationsRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void): ClientUnaryCall;
142
+ removeIntegration(request: RemoveIntegrationRequest, callback: (error: ServiceError | null, response: Empty) => void): ClientUnaryCall;
143
+ removeIntegration(request: RemoveIntegrationRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Empty) => void): ClientUnaryCall;
144
+ removeIntegration(request: RemoveIntegrationRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: Empty) => void): ClientUnaryCall;
87
145
  }
88
146
  export declare const MessengerServiceClient: {
89
147
  new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): MessengerServiceClient;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessengerServiceClient = exports.MessengerServiceService = exports.LinkTelegramAccountResponse = exports.LinkTelegramAccountRequest = exports.TelegramMeta_HeadersEntry = exports.TelegramMeta = exports.LinkTelegramAccountResponsePayload = exports.LinkTelegramAccountRequestPayload = exports.GenerateTelegramLinkResponse = exports.GenerateTelegramLinkRequest = exports.LinkTelegramAccountStatus = exports.protobufPackage = void 0;
3
+ exports.MessengerServiceClient = exports.MessengerServiceService = exports.RemoveIntegrationRequest = exports.GetIntegrationsResponse = exports.Integration_MetaEntry = exports.Integration = exports.GetIntegrationsRequest = exports.LinkTelegramAccountResponse = exports.LinkTelegramAccountRequest = exports.TelegramMeta_HeadersEntry = exports.TelegramMeta = exports.LinkTelegramAccountResponsePayload = exports.LinkTelegramAccountRequestPayload = exports.GenerateTelegramLinkResponse = exports.GenerateTelegramLinkRequest = exports.LinkTelegramAccountStatus = exports.protobufPackage = void 0;
4
4
  exports.linkTelegramAccountStatusFromJSON = linkTelegramAccountStatusFromJSON;
5
5
  exports.linkTelegramAccountStatusToJSON = linkTelegramAccountStatusToJSON;
6
6
  const wire_1 = require("@bufbuild/protobuf/wire");
7
7
  const grpc_js_1 = require("@grpc/grpc-js");
8
+ const empty_1 = require("./google/protobuf/empty");
8
9
  exports.protobufPackage = "messenger.v1";
9
10
  var LinkTelegramAccountStatus;
10
11
  (function (LinkTelegramAccountStatus) {
@@ -632,6 +633,459 @@ exports.LinkTelegramAccountResponse = {
632
633
  return message;
633
634
  },
634
635
  };
636
+ function createBaseGetIntegrationsRequest() {
637
+ return { userId: 0 };
638
+ }
639
+ exports.GetIntegrationsRequest = {
640
+ encode(message, writer = new wire_1.BinaryWriter()) {
641
+ if (message.userId !== 0) {
642
+ writer.uint32(8).int32(message.userId);
643
+ }
644
+ return writer;
645
+ },
646
+ decode(input, length) {
647
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
648
+ const end = length === undefined ? reader.len : reader.pos + length;
649
+ const message = createBaseGetIntegrationsRequest();
650
+ while (reader.pos < end) {
651
+ const tag = reader.uint32();
652
+ switch (tag >>> 3) {
653
+ case 1: {
654
+ if (tag !== 8) {
655
+ break;
656
+ }
657
+ message.userId = reader.int32();
658
+ continue;
659
+ }
660
+ }
661
+ if ((tag & 7) === 4 || tag === 0) {
662
+ break;
663
+ }
664
+ reader.skip(tag & 7);
665
+ }
666
+ return message;
667
+ },
668
+ fromJSON(object) {
669
+ return {
670
+ userId: isSet(object.userId)
671
+ ? globalThis.Number(object.userId)
672
+ : isSet(object.user_id)
673
+ ? globalThis.Number(object.user_id)
674
+ : 0,
675
+ };
676
+ },
677
+ toJSON(message) {
678
+ const obj = {};
679
+ if (message.userId !== 0) {
680
+ obj.userId = Math.round(message.userId);
681
+ }
682
+ return obj;
683
+ },
684
+ create(base) {
685
+ return exports.GetIntegrationsRequest.fromPartial(base ?? {});
686
+ },
687
+ fromPartial(object) {
688
+ const message = createBaseGetIntegrationsRequest();
689
+ message.userId = object.userId ?? 0;
690
+ return message;
691
+ },
692
+ };
693
+ function createBaseIntegration() {
694
+ return { id: 0, meta: {}, messenger: "", messengerId: "", userId: 0, createdAt: 0, updatedAt: 0, deletedAt: 0 };
695
+ }
696
+ exports.Integration = {
697
+ encode(message, writer = new wire_1.BinaryWriter()) {
698
+ if (message.id !== 0) {
699
+ writer.uint32(8).int32(message.id);
700
+ }
701
+ globalThis.Object.entries(message.meta).forEach(([key, value]) => {
702
+ exports.Integration_MetaEntry.encode({ key: key, value }, writer.uint32(18).fork()).join();
703
+ });
704
+ if (message.messenger !== "") {
705
+ writer.uint32(26).string(message.messenger);
706
+ }
707
+ if (message.messengerId !== "") {
708
+ writer.uint32(34).string(message.messengerId);
709
+ }
710
+ if (message.userId !== 0) {
711
+ writer.uint32(40).int32(message.userId);
712
+ }
713
+ if (message.createdAt !== 0) {
714
+ writer.uint32(48).int32(message.createdAt);
715
+ }
716
+ if (message.updatedAt !== 0) {
717
+ writer.uint32(56).int32(message.updatedAt);
718
+ }
719
+ if (message.deletedAt !== 0) {
720
+ writer.uint32(64).int32(message.deletedAt);
721
+ }
722
+ return writer;
723
+ },
724
+ decode(input, length) {
725
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
726
+ const end = length === undefined ? reader.len : reader.pos + length;
727
+ const message = createBaseIntegration();
728
+ while (reader.pos < end) {
729
+ const tag = reader.uint32();
730
+ switch (tag >>> 3) {
731
+ case 1: {
732
+ if (tag !== 8) {
733
+ break;
734
+ }
735
+ message.id = reader.int32();
736
+ continue;
737
+ }
738
+ case 2: {
739
+ if (tag !== 18) {
740
+ break;
741
+ }
742
+ const entry2 = exports.Integration_MetaEntry.decode(reader, reader.uint32());
743
+ if (entry2.value !== undefined) {
744
+ message.meta[entry2.key] = entry2.value;
745
+ }
746
+ continue;
747
+ }
748
+ case 3: {
749
+ if (tag !== 26) {
750
+ break;
751
+ }
752
+ message.messenger = reader.string();
753
+ continue;
754
+ }
755
+ case 4: {
756
+ if (tag !== 34) {
757
+ break;
758
+ }
759
+ message.messengerId = reader.string();
760
+ continue;
761
+ }
762
+ case 5: {
763
+ if (tag !== 40) {
764
+ break;
765
+ }
766
+ message.userId = reader.int32();
767
+ continue;
768
+ }
769
+ case 6: {
770
+ if (tag !== 48) {
771
+ break;
772
+ }
773
+ message.createdAt = reader.int32();
774
+ continue;
775
+ }
776
+ case 7: {
777
+ if (tag !== 56) {
778
+ break;
779
+ }
780
+ message.updatedAt = reader.int32();
781
+ continue;
782
+ }
783
+ case 8: {
784
+ if (tag !== 64) {
785
+ break;
786
+ }
787
+ message.deletedAt = reader.int32();
788
+ continue;
789
+ }
790
+ }
791
+ if ((tag & 7) === 4 || tag === 0) {
792
+ break;
793
+ }
794
+ reader.skip(tag & 7);
795
+ }
796
+ return message;
797
+ },
798
+ fromJSON(object) {
799
+ return {
800
+ id: isSet(object.id) ? globalThis.Number(object.id) : 0,
801
+ meta: isObject(object.meta)
802
+ ? globalThis.Object.entries(object.meta).reduce((acc, [key, value]) => {
803
+ acc[key] = globalThis.String(value);
804
+ return acc;
805
+ }, {})
806
+ : {},
807
+ messenger: isSet(object.messenger) ? globalThis.String(object.messenger) : "",
808
+ messengerId: isSet(object.messengerId)
809
+ ? globalThis.String(object.messengerId)
810
+ : isSet(object.messenger_id)
811
+ ? globalThis.String(object.messenger_id)
812
+ : "",
813
+ userId: isSet(object.userId)
814
+ ? globalThis.Number(object.userId)
815
+ : isSet(object.user_id)
816
+ ? globalThis.Number(object.user_id)
817
+ : 0,
818
+ createdAt: isSet(object.createdAt)
819
+ ? globalThis.Number(object.createdAt)
820
+ : isSet(object.created_at)
821
+ ? globalThis.Number(object.created_at)
822
+ : 0,
823
+ updatedAt: isSet(object.updatedAt)
824
+ ? globalThis.Number(object.updatedAt)
825
+ : isSet(object.updated_at)
826
+ ? globalThis.Number(object.updated_at)
827
+ : 0,
828
+ deletedAt: isSet(object.deletedAt)
829
+ ? globalThis.Number(object.deletedAt)
830
+ : isSet(object.deleted_at)
831
+ ? globalThis.Number(object.deleted_at)
832
+ : 0,
833
+ };
834
+ },
835
+ toJSON(message) {
836
+ const obj = {};
837
+ if (message.id !== 0) {
838
+ obj.id = Math.round(message.id);
839
+ }
840
+ if (message.meta) {
841
+ const entries = globalThis.Object.entries(message.meta);
842
+ if (entries.length > 0) {
843
+ obj.meta = {};
844
+ entries.forEach(([k, v]) => {
845
+ obj.meta[k] = v;
846
+ });
847
+ }
848
+ }
849
+ if (message.messenger !== "") {
850
+ obj.messenger = message.messenger;
851
+ }
852
+ if (message.messengerId !== "") {
853
+ obj.messengerId = message.messengerId;
854
+ }
855
+ if (message.userId !== 0) {
856
+ obj.userId = Math.round(message.userId);
857
+ }
858
+ if (message.createdAt !== 0) {
859
+ obj.createdAt = Math.round(message.createdAt);
860
+ }
861
+ if (message.updatedAt !== 0) {
862
+ obj.updatedAt = Math.round(message.updatedAt);
863
+ }
864
+ if (message.deletedAt !== 0) {
865
+ obj.deletedAt = Math.round(message.deletedAt);
866
+ }
867
+ return obj;
868
+ },
869
+ create(base) {
870
+ return exports.Integration.fromPartial(base ?? {});
871
+ },
872
+ fromPartial(object) {
873
+ const message = createBaseIntegration();
874
+ message.id = object.id ?? 0;
875
+ message.meta = globalThis.Object.entries(object.meta ?? {}).reduce((acc, [key, value]) => {
876
+ if (value !== undefined) {
877
+ acc[key] = globalThis.String(value);
878
+ }
879
+ return acc;
880
+ }, {});
881
+ message.messenger = object.messenger ?? "";
882
+ message.messengerId = object.messengerId ?? "";
883
+ message.userId = object.userId ?? 0;
884
+ message.createdAt = object.createdAt ?? 0;
885
+ message.updatedAt = object.updatedAt ?? 0;
886
+ message.deletedAt = object.deletedAt ?? 0;
887
+ return message;
888
+ },
889
+ };
890
+ function createBaseIntegration_MetaEntry() {
891
+ return { key: "", value: "" };
892
+ }
893
+ exports.Integration_MetaEntry = {
894
+ encode(message, writer = new wire_1.BinaryWriter()) {
895
+ if (message.key !== "") {
896
+ writer.uint32(10).string(message.key);
897
+ }
898
+ if (message.value !== "") {
899
+ writer.uint32(18).string(message.value);
900
+ }
901
+ return writer;
902
+ },
903
+ decode(input, length) {
904
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
905
+ const end = length === undefined ? reader.len : reader.pos + length;
906
+ const message = createBaseIntegration_MetaEntry();
907
+ while (reader.pos < end) {
908
+ const tag = reader.uint32();
909
+ switch (tag >>> 3) {
910
+ case 1: {
911
+ if (tag !== 10) {
912
+ break;
913
+ }
914
+ message.key = reader.string();
915
+ continue;
916
+ }
917
+ case 2: {
918
+ if (tag !== 18) {
919
+ break;
920
+ }
921
+ message.value = reader.string();
922
+ continue;
923
+ }
924
+ }
925
+ if ((tag & 7) === 4 || tag === 0) {
926
+ break;
927
+ }
928
+ reader.skip(tag & 7);
929
+ }
930
+ return message;
931
+ },
932
+ fromJSON(object) {
933
+ return {
934
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
935
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
936
+ };
937
+ },
938
+ toJSON(message) {
939
+ const obj = {};
940
+ if (message.key !== "") {
941
+ obj.key = message.key;
942
+ }
943
+ if (message.value !== "") {
944
+ obj.value = message.value;
945
+ }
946
+ return obj;
947
+ },
948
+ create(base) {
949
+ return exports.Integration_MetaEntry.fromPartial(base ?? {});
950
+ },
951
+ fromPartial(object) {
952
+ const message = createBaseIntegration_MetaEntry();
953
+ message.key = object.key ?? "";
954
+ message.value = object.value ?? "";
955
+ return message;
956
+ },
957
+ };
958
+ function createBaseGetIntegrationsResponse() {
959
+ return { integrations: [] };
960
+ }
961
+ exports.GetIntegrationsResponse = {
962
+ encode(message, writer = new wire_1.BinaryWriter()) {
963
+ for (const v of message.integrations) {
964
+ exports.Integration.encode(v, writer.uint32(10).fork()).join();
965
+ }
966
+ return writer;
967
+ },
968
+ decode(input, length) {
969
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
970
+ const end = length === undefined ? reader.len : reader.pos + length;
971
+ const message = createBaseGetIntegrationsResponse();
972
+ while (reader.pos < end) {
973
+ const tag = reader.uint32();
974
+ switch (tag >>> 3) {
975
+ case 1: {
976
+ if (tag !== 10) {
977
+ break;
978
+ }
979
+ message.integrations.push(exports.Integration.decode(reader, reader.uint32()));
980
+ continue;
981
+ }
982
+ }
983
+ if ((tag & 7) === 4 || tag === 0) {
984
+ break;
985
+ }
986
+ reader.skip(tag & 7);
987
+ }
988
+ return message;
989
+ },
990
+ fromJSON(object) {
991
+ return {
992
+ integrations: globalThis.Array.isArray(object?.integrations)
993
+ ? object.integrations.map((e) => exports.Integration.fromJSON(e))
994
+ : [],
995
+ };
996
+ },
997
+ toJSON(message) {
998
+ const obj = {};
999
+ if (message.integrations?.length) {
1000
+ obj.integrations = message.integrations.map((e) => exports.Integration.toJSON(e));
1001
+ }
1002
+ return obj;
1003
+ },
1004
+ create(base) {
1005
+ return exports.GetIntegrationsResponse.fromPartial(base ?? {});
1006
+ },
1007
+ fromPartial(object) {
1008
+ const message = createBaseGetIntegrationsResponse();
1009
+ message.integrations = object.integrations?.map((e) => exports.Integration.fromPartial(e)) || [];
1010
+ return message;
1011
+ },
1012
+ };
1013
+ function createBaseRemoveIntegrationRequest() {
1014
+ return { integrationId: 0, userId: 0 };
1015
+ }
1016
+ exports.RemoveIntegrationRequest = {
1017
+ encode(message, writer = new wire_1.BinaryWriter()) {
1018
+ if (message.integrationId !== 0) {
1019
+ writer.uint32(8).int32(message.integrationId);
1020
+ }
1021
+ if (message.userId !== 0) {
1022
+ writer.uint32(16).int32(message.userId);
1023
+ }
1024
+ return writer;
1025
+ },
1026
+ decode(input, length) {
1027
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1028
+ const end = length === undefined ? reader.len : reader.pos + length;
1029
+ const message = createBaseRemoveIntegrationRequest();
1030
+ while (reader.pos < end) {
1031
+ const tag = reader.uint32();
1032
+ switch (tag >>> 3) {
1033
+ case 1: {
1034
+ if (tag !== 8) {
1035
+ break;
1036
+ }
1037
+ message.integrationId = reader.int32();
1038
+ continue;
1039
+ }
1040
+ case 2: {
1041
+ if (tag !== 16) {
1042
+ break;
1043
+ }
1044
+ message.userId = reader.int32();
1045
+ continue;
1046
+ }
1047
+ }
1048
+ if ((tag & 7) === 4 || tag === 0) {
1049
+ break;
1050
+ }
1051
+ reader.skip(tag & 7);
1052
+ }
1053
+ return message;
1054
+ },
1055
+ fromJSON(object) {
1056
+ return {
1057
+ integrationId: isSet(object.integrationId)
1058
+ ? globalThis.Number(object.integrationId)
1059
+ : isSet(object.integration_id)
1060
+ ? globalThis.Number(object.integration_id)
1061
+ : 0,
1062
+ userId: isSet(object.userId)
1063
+ ? globalThis.Number(object.userId)
1064
+ : isSet(object.user_id)
1065
+ ? globalThis.Number(object.user_id)
1066
+ : 0,
1067
+ };
1068
+ },
1069
+ toJSON(message) {
1070
+ const obj = {};
1071
+ if (message.integrationId !== 0) {
1072
+ obj.integrationId = Math.round(message.integrationId);
1073
+ }
1074
+ if (message.userId !== 0) {
1075
+ obj.userId = Math.round(message.userId);
1076
+ }
1077
+ return obj;
1078
+ },
1079
+ create(base) {
1080
+ return exports.RemoveIntegrationRequest.fromPartial(base ?? {});
1081
+ },
1082
+ fromPartial(object) {
1083
+ const message = createBaseRemoveIntegrationRequest();
1084
+ message.integrationId = object.integrationId ?? 0;
1085
+ message.userId = object.userId ?? 0;
1086
+ return message;
1087
+ },
1088
+ };
635
1089
  exports.MessengerServiceService = {
636
1090
  generateTelegramLink: {
637
1091
  path: "/messenger.v1.MessengerService/GenerateTelegramLink",
@@ -651,6 +1105,24 @@ exports.MessengerServiceService = {
651
1105
  responseSerialize: (value) => Buffer.from(exports.LinkTelegramAccountResponse.encode(value).finish()),
652
1106
  responseDeserialize: (value) => exports.LinkTelegramAccountResponse.decode(value),
653
1107
  },
1108
+ getIntegrations: {
1109
+ path: "/messenger.v1.MessengerService/GetIntegrations",
1110
+ requestStream: false,
1111
+ responseStream: false,
1112
+ requestSerialize: (value) => Buffer.from(exports.GetIntegrationsRequest.encode(value).finish()),
1113
+ requestDeserialize: (value) => exports.GetIntegrationsRequest.decode(value),
1114
+ responseSerialize: (value) => Buffer.from(exports.GetIntegrationsResponse.encode(value).finish()),
1115
+ responseDeserialize: (value) => exports.GetIntegrationsResponse.decode(value),
1116
+ },
1117
+ removeIntegration: {
1118
+ path: "/messenger.v1.MessengerService/RemoveIntegration",
1119
+ requestStream: false,
1120
+ responseStream: false,
1121
+ requestSerialize: (value) => Buffer.from(exports.RemoveIntegrationRequest.encode(value).finish()),
1122
+ requestDeserialize: (value) => exports.RemoveIntegrationRequest.decode(value),
1123
+ responseSerialize: (value) => Buffer.from(empty_1.Empty.encode(value).finish()),
1124
+ responseDeserialize: (value) => empty_1.Empty.decode(value),
1125
+ },
654
1126
  };
655
1127
  exports.MessengerServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.MessengerServiceService, "messenger.v1.MessengerService");
656
1128
  function longToNumber(int64) {