@control_yourself/contracts 0.3.1 → 0.3.2

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,31 @@ 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
+ id: number;
65
+ };
66
+ export declare const RemoveIntegrationRequestSchema: GenMessage<RemoveIntegrationRequest>;
41
67
  export declare enum LinkTelegramAccountStatus {
42
68
  STATUS_UNSPECIFIED = 0,
43
69
  STATUS_COMPLETED = 1,
@@ -56,4 +82,14 @@ export declare const MessengerService: GenService<{
56
82
  input: typeof LinkTelegramAccountRequestSchema;
57
83
  output: typeof LinkTelegramAccountResponseSchema;
58
84
  };
85
+ getIntegrations: {
86
+ methodKind: "unary";
87
+ input: typeof GetIntegrationsRequestSchema;
88
+ output: typeof GetIntegrationsResponseSchema;
89
+ };
90
+ removeIntegration: {
91
+ methodKind: "unary";
92
+ input: typeof RemoveIntegrationRequestSchema;
93
+ output: typeof EmptySchema;
94
+ };
59
95
  }>;
@@ -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)("Cg9tZXNzZW5nZXIucHJvdG8SDG1lc3Nlbmdlci52MSIuChtHZW5lcmF0ZVRlbGVncmFtTGlua1JlcXVlc3QSDwoHdXNlcl9pZBgBIAEoBSIsChxHZW5lcmF0ZVRlbGVncmFtTGlua1Jlc3BvbnNlEgwKBGxpbmsYASABKAkiMgohTGlua1RlbGVncmFtQWNjb3VudFJlcX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yYXRlVGVsZWdyYW1MaW5rUmVxdWVzdBoqLm1lc3Nlbmdlci52MS5HZW5lcmF0ZVRlbGVncmFtTGlua1Jlc3BvbnNlEmoKE0xpbmtUZWxlZ3JhbUFjY291bnQSKC5tZXNzZW5nZXIudjEuTGlua1RlbGVncmFtQWNjb3VudFJlcXVlc3QaKS5tZXNzZW5nZXIudjEuTGlua1RlbGVncmFtQWNjb3VudFJlc3BvbnNlEl4KD0dldEludGVncmF0aW9ucxIkLm1lc3Nlbmdlci52MS5HZXRJbnRlZ3JhdGlvbnNSZXF1ZXN0GiUubWVzc2VuZ2VyLnYxLkdldEludGVncmF0aW9uc1Jlc3BvbnNlElMKEVJlbW92ZUludGVncmF0aW9uEiYubWVzc2VuZ2VyLnYxLlJlbW92ZUludGVncmF0aW9uUmVxdWVzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eWIGcHJvdG8z", [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,sBAAc,EAAE,CAAC,CAAC,CAAC;AAKjB,QAAA,gBAAgB,G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pB,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,31 @@ 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
+ id: number;
72
+ }
47
73
  export declare const GenerateTelegramLinkRequest: MessageFns<GenerateTelegramLinkRequest>;
48
74
  export declare const GenerateTelegramLinkResponse: MessageFns<GenerateTelegramLinkResponse>;
49
75
  export declare const LinkTelegramAccountRequestPayload: MessageFns<LinkTelegramAccountRequestPayload>;
@@ -52,6 +78,11 @@ export declare const TelegramMeta: MessageFns<TelegramMeta>;
52
78
  export declare const TelegramMeta_HeadersEntry: MessageFns<TelegramMeta_HeadersEntry>;
53
79
  export declare const LinkTelegramAccountRequest: MessageFns<LinkTelegramAccountRequest>;
54
80
  export declare const LinkTelegramAccountResponse: MessageFns<LinkTelegramAccountResponse>;
81
+ export declare const GetIntegrationsRequest: MessageFns<GetIntegrationsRequest>;
82
+ export declare const Integration: MessageFns<Integration>;
83
+ export declare const Integration_MetaEntry: MessageFns<Integration_MetaEntry>;
84
+ export declare const GetIntegrationsResponse: MessageFns<GetIntegrationsResponse>;
85
+ export declare const RemoveIntegrationRequest: MessageFns<RemoveIntegrationRequest>;
55
86
  export type MessengerServiceService = typeof MessengerServiceService;
56
87
  export declare const MessengerServiceService: {
57
88
  readonly generateTelegramLink: {
@@ -72,10 +103,30 @@ export declare const MessengerServiceService: {
72
103
  readonly responseSerialize: (value: LinkTelegramAccountResponse) => Buffer;
73
104
  readonly responseDeserialize: (value: Buffer) => LinkTelegramAccountResponse;
74
105
  };
106
+ readonly getIntegrations: {
107
+ readonly path: "/messenger.v1.MessengerService/GetIntegrations";
108
+ readonly requestStream: false;
109
+ readonly responseStream: false;
110
+ readonly requestSerialize: (value: GetIntegrationsRequest) => Buffer;
111
+ readonly requestDeserialize: (value: Buffer) => GetIntegrationsRequest;
112
+ readonly responseSerialize: (value: GetIntegrationsResponse) => Buffer;
113
+ readonly responseDeserialize: (value: Buffer) => GetIntegrationsResponse;
114
+ };
115
+ readonly removeIntegration: {
116
+ readonly path: "/messenger.v1.MessengerService/RemoveIntegration";
117
+ readonly requestStream: false;
118
+ readonly responseStream: false;
119
+ readonly requestSerialize: (value: RemoveIntegrationRequest) => Buffer;
120
+ readonly requestDeserialize: (value: Buffer) => RemoveIntegrationRequest;
121
+ readonly responseSerialize: (value: Empty) => Buffer;
122
+ readonly responseDeserialize: (value: Buffer) => Empty;
123
+ };
75
124
  };
76
125
  export interface MessengerServiceServer extends UntypedServiceImplementation {
77
126
  generateTelegramLink: handleUnaryCall<GenerateTelegramLinkRequest, GenerateTelegramLinkResponse>;
78
127
  linkTelegramAccount: handleUnaryCall<LinkTelegramAccountRequest, LinkTelegramAccountResponse>;
128
+ getIntegrations: handleUnaryCall<GetIntegrationsRequest, GetIntegrationsResponse>;
129
+ removeIntegration: handleUnaryCall<RemoveIntegrationRequest, Empty>;
79
130
  }
80
131
  export interface MessengerServiceClient extends Client {
81
132
  generateTelegramLink(request: GenerateTelegramLinkRequest, callback: (error: ServiceError | null, response: GenerateTelegramLinkResponse) => void): ClientUnaryCall;
@@ -84,6 +135,12 @@ export interface MessengerServiceClient extends Client {
84
135
  linkTelegramAccount(request: LinkTelegramAccountRequest, callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void): ClientUnaryCall;
85
136
  linkTelegramAccount(request: LinkTelegramAccountRequest, metadata: Metadata, callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void): ClientUnaryCall;
86
137
  linkTelegramAccount(request: LinkTelegramAccountRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: LinkTelegramAccountResponse) => void): ClientUnaryCall;
138
+ getIntegrations(request: GetIntegrationsRequest, callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void): ClientUnaryCall;
139
+ getIntegrations(request: GetIntegrationsRequest, metadata: Metadata, callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void): ClientUnaryCall;
140
+ getIntegrations(request: GetIntegrationsRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void): ClientUnaryCall;
141
+ removeIntegration(request: RemoveIntegrationRequest, callback: (error: ServiceError | null, response: Empty) => void): ClientUnaryCall;
142
+ removeIntegration(request: RemoveIntegrationRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Empty) => void): ClientUnaryCall;
143
+ removeIntegration(request: RemoveIntegrationRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: Empty) => void): ClientUnaryCall;
87
144
  }
88
145
  export declare const MessengerServiceClient: {
89
146
  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,434 @@ 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 { id: 0 };
1015
+ }
1016
+ exports.RemoveIntegrationRequest = {
1017
+ encode(message, writer = new wire_1.BinaryWriter()) {
1018
+ if (message.id !== 0) {
1019
+ writer.uint32(8).int32(message.id);
1020
+ }
1021
+ return writer;
1022
+ },
1023
+ decode(input, length) {
1024
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1025
+ const end = length === undefined ? reader.len : reader.pos + length;
1026
+ const message = createBaseRemoveIntegrationRequest();
1027
+ while (reader.pos < end) {
1028
+ const tag = reader.uint32();
1029
+ switch (tag >>> 3) {
1030
+ case 1: {
1031
+ if (tag !== 8) {
1032
+ break;
1033
+ }
1034
+ message.id = reader.int32();
1035
+ continue;
1036
+ }
1037
+ }
1038
+ if ((tag & 7) === 4 || tag === 0) {
1039
+ break;
1040
+ }
1041
+ reader.skip(tag & 7);
1042
+ }
1043
+ return message;
1044
+ },
1045
+ fromJSON(object) {
1046
+ return { id: isSet(object.id) ? globalThis.Number(object.id) : 0 };
1047
+ },
1048
+ toJSON(message) {
1049
+ const obj = {};
1050
+ if (message.id !== 0) {
1051
+ obj.id = Math.round(message.id);
1052
+ }
1053
+ return obj;
1054
+ },
1055
+ create(base) {
1056
+ return exports.RemoveIntegrationRequest.fromPartial(base ?? {});
1057
+ },
1058
+ fromPartial(object) {
1059
+ const message = createBaseRemoveIntegrationRequest();
1060
+ message.id = object.id ?? 0;
1061
+ return message;
1062
+ },
1063
+ };
635
1064
  exports.MessengerServiceService = {
636
1065
  generateTelegramLink: {
637
1066
  path: "/messenger.v1.MessengerService/GenerateTelegramLink",
@@ -651,6 +1080,24 @@ exports.MessengerServiceService = {
651
1080
  responseSerialize: (value) => Buffer.from(exports.LinkTelegramAccountResponse.encode(value).finish()),
652
1081
  responseDeserialize: (value) => exports.LinkTelegramAccountResponse.decode(value),
653
1082
  },
1083
+ getIntegrations: {
1084
+ path: "/messenger.v1.MessengerService/GetIntegrations",
1085
+ requestStream: false,
1086
+ responseStream: false,
1087
+ requestSerialize: (value) => Buffer.from(exports.GetIntegrationsRequest.encode(value).finish()),
1088
+ requestDeserialize: (value) => exports.GetIntegrationsRequest.decode(value),
1089
+ responseSerialize: (value) => Buffer.from(exports.GetIntegrationsResponse.encode(value).finish()),
1090
+ responseDeserialize: (value) => exports.GetIntegrationsResponse.decode(value),
1091
+ },
1092
+ removeIntegration: {
1093
+ path: "/messenger.v1.MessengerService/RemoveIntegration",
1094
+ requestStream: false,
1095
+ responseStream: false,
1096
+ requestSerialize: (value) => Buffer.from(exports.RemoveIntegrationRequest.encode(value).finish()),
1097
+ requestDeserialize: (value) => exports.RemoveIntegrationRequest.decode(value),
1098
+ responseSerialize: (value) => Buffer.from(empty_1.Empty.encode(value).finish()),
1099
+ responseDeserialize: (value) => empty_1.Empty.decode(value),
1100
+ },
654
1101
  };
655
1102
  exports.MessengerServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.MessengerServiceService, "messenger.v1.MessengerService");
656
1103
  function longToNumber(int64) {