@control_yourself/contracts 0.3.3 → 0.3.4
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/integration_pb.d.ts +42 -0
- package/dist/generated/integration_pb.js +12 -0
- package/dist/generated/integration_pb.js.map +1 -0
- package/dist/generated/messenger_pb.d.ts +0 -37
- package/dist/generated/messenger_pb.js +2 -7
- package/dist/generated/messenger_pb.js.map +1 -1
- package/dist/generated-grpc/integration.d.ts +92 -0
- package/dist/generated-grpc/integration.js +488 -0
- package/dist/generated-grpc/integration.js.map +1 -0
- package/dist/generated-grpc/messenger.d.ts +0 -58
- package/dist/generated-grpc/messenger.js +1 -473
- package/dist/generated-grpc/messenger.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/generated/integration_pb.ts +147 -0
- package/generated/messenger_pb.ts +1 -127
- package/generated-grpc/integration.ts +656 -0
- package/generated-grpc/messenger.ts +0 -586
- package/package.json +1 -1
- package/protos/integration.proto +33 -0
- package/protos/messenger.proto +1 -28
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: integration.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import {
|
|
10
|
+
type CallOptions,
|
|
11
|
+
type ChannelCredentials,
|
|
12
|
+
Client,
|
|
13
|
+
type ClientOptions,
|
|
14
|
+
type ClientUnaryCall,
|
|
15
|
+
type handleUnaryCall,
|
|
16
|
+
makeGenericClientConstructor,
|
|
17
|
+
type Metadata,
|
|
18
|
+
type ServiceError,
|
|
19
|
+
type UntypedServiceImplementation,
|
|
20
|
+
} from "@grpc/grpc-js";
|
|
21
|
+
import { Empty } from "./google/protobuf/empty";
|
|
22
|
+
|
|
23
|
+
export const protobufPackage = "integration.v1";
|
|
24
|
+
|
|
25
|
+
export interface GetIntegrationsRequest {
|
|
26
|
+
userId: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Integration {
|
|
30
|
+
id: number;
|
|
31
|
+
meta: { [key: string]: string };
|
|
32
|
+
messenger: string;
|
|
33
|
+
messengerId: string;
|
|
34
|
+
userId: number;
|
|
35
|
+
createdAt: number;
|
|
36
|
+
updatedAt: number;
|
|
37
|
+
deletedAt: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Integration_MetaEntry {
|
|
41
|
+
key: string;
|
|
42
|
+
value: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetIntegrationsResponse {
|
|
46
|
+
integrations: Integration[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface RemoveIntegrationRequest {
|
|
50
|
+
integrationId: number;
|
|
51
|
+
userId: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function createBaseGetIntegrationsRequest(): GetIntegrationsRequest {
|
|
55
|
+
return { userId: 0 };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const GetIntegrationsRequest: MessageFns<GetIntegrationsRequest> = {
|
|
59
|
+
encode(message: GetIntegrationsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
60
|
+
if (message.userId !== 0) {
|
|
61
|
+
writer.uint32(8).int32(message.userId);
|
|
62
|
+
}
|
|
63
|
+
return writer;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetIntegrationsRequest {
|
|
67
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
68
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
69
|
+
const message = createBaseGetIntegrationsRequest();
|
|
70
|
+
while (reader.pos < end) {
|
|
71
|
+
const tag = reader.uint32();
|
|
72
|
+
switch (tag >>> 3) {
|
|
73
|
+
case 1: {
|
|
74
|
+
if (tag !== 8) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message.userId = reader.int32();
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
reader.skip(tag & 7);
|
|
86
|
+
}
|
|
87
|
+
return message;
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
fromJSON(object: any): GetIntegrationsRequest {
|
|
91
|
+
return {
|
|
92
|
+
userId: isSet(object.userId)
|
|
93
|
+
? globalThis.Number(object.userId)
|
|
94
|
+
: isSet(object.user_id)
|
|
95
|
+
? globalThis.Number(object.user_id)
|
|
96
|
+
: 0,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
toJSON(message: GetIntegrationsRequest): unknown {
|
|
101
|
+
const obj: any = {};
|
|
102
|
+
if (message.userId !== 0) {
|
|
103
|
+
obj.userId = Math.round(message.userId);
|
|
104
|
+
}
|
|
105
|
+
return obj;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
create<I extends Exact<DeepPartial<GetIntegrationsRequest>, I>>(base?: I): GetIntegrationsRequest {
|
|
109
|
+
return GetIntegrationsRequest.fromPartial(base ?? ({} as any));
|
|
110
|
+
},
|
|
111
|
+
fromPartial<I extends Exact<DeepPartial<GetIntegrationsRequest>, I>>(object: I): GetIntegrationsRequest {
|
|
112
|
+
const message = createBaseGetIntegrationsRequest();
|
|
113
|
+
message.userId = object.userId ?? 0;
|
|
114
|
+
return message;
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
function createBaseIntegration(): Integration {
|
|
119
|
+
return { id: 0, meta: {}, messenger: "", messengerId: "", userId: 0, createdAt: 0, updatedAt: 0, deletedAt: 0 };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const Integration: MessageFns<Integration> = {
|
|
123
|
+
encode(message: Integration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
124
|
+
if (message.id !== 0) {
|
|
125
|
+
writer.uint32(8).int32(message.id);
|
|
126
|
+
}
|
|
127
|
+
globalThis.Object.entries(message.meta).forEach(([key, value]: [string, string]) => {
|
|
128
|
+
Integration_MetaEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
|
|
129
|
+
});
|
|
130
|
+
if (message.messenger !== "") {
|
|
131
|
+
writer.uint32(26).string(message.messenger);
|
|
132
|
+
}
|
|
133
|
+
if (message.messengerId !== "") {
|
|
134
|
+
writer.uint32(34).string(message.messengerId);
|
|
135
|
+
}
|
|
136
|
+
if (message.userId !== 0) {
|
|
137
|
+
writer.uint32(40).int32(message.userId);
|
|
138
|
+
}
|
|
139
|
+
if (message.createdAt !== 0) {
|
|
140
|
+
writer.uint32(48).int32(message.createdAt);
|
|
141
|
+
}
|
|
142
|
+
if (message.updatedAt !== 0) {
|
|
143
|
+
writer.uint32(56).int32(message.updatedAt);
|
|
144
|
+
}
|
|
145
|
+
if (message.deletedAt !== 0) {
|
|
146
|
+
writer.uint32(64).int32(message.deletedAt);
|
|
147
|
+
}
|
|
148
|
+
return writer;
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Integration {
|
|
152
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
153
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
154
|
+
const message = createBaseIntegration();
|
|
155
|
+
while (reader.pos < end) {
|
|
156
|
+
const tag = reader.uint32();
|
|
157
|
+
switch (tag >>> 3) {
|
|
158
|
+
case 1: {
|
|
159
|
+
if (tag !== 8) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
message.id = reader.int32();
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
case 2: {
|
|
167
|
+
if (tag !== 18) {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const entry2 = Integration_MetaEntry.decode(reader, reader.uint32());
|
|
172
|
+
if (entry2.value !== undefined) {
|
|
173
|
+
message.meta[entry2.key] = entry2.value;
|
|
174
|
+
}
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
case 3: {
|
|
178
|
+
if (tag !== 26) {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
message.messenger = reader.string();
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
case 4: {
|
|
186
|
+
if (tag !== 34) {
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
message.messengerId = reader.string();
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
case 5: {
|
|
194
|
+
if (tag !== 40) {
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
message.userId = reader.int32();
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
case 6: {
|
|
202
|
+
if (tag !== 48) {
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
message.createdAt = reader.int32();
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
case 7: {
|
|
210
|
+
if (tag !== 56) {
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
message.updatedAt = reader.int32();
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
case 8: {
|
|
218
|
+
if (tag !== 64) {
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
message.deletedAt = reader.int32();
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
reader.skip(tag & 7);
|
|
230
|
+
}
|
|
231
|
+
return message;
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
fromJSON(object: any): Integration {
|
|
235
|
+
return {
|
|
236
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
237
|
+
meta: isObject(object.meta)
|
|
238
|
+
? (globalThis.Object.entries(object.meta) as [string, any][]).reduce(
|
|
239
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
240
|
+
acc[key] = globalThis.String(value);
|
|
241
|
+
return acc;
|
|
242
|
+
},
|
|
243
|
+
{},
|
|
244
|
+
)
|
|
245
|
+
: {},
|
|
246
|
+
messenger: isSet(object.messenger) ? globalThis.String(object.messenger) : "",
|
|
247
|
+
messengerId: isSet(object.messengerId)
|
|
248
|
+
? globalThis.String(object.messengerId)
|
|
249
|
+
: isSet(object.messenger_id)
|
|
250
|
+
? globalThis.String(object.messenger_id)
|
|
251
|
+
: "",
|
|
252
|
+
userId: isSet(object.userId)
|
|
253
|
+
? globalThis.Number(object.userId)
|
|
254
|
+
: isSet(object.user_id)
|
|
255
|
+
? globalThis.Number(object.user_id)
|
|
256
|
+
: 0,
|
|
257
|
+
createdAt: isSet(object.createdAt)
|
|
258
|
+
? globalThis.Number(object.createdAt)
|
|
259
|
+
: isSet(object.created_at)
|
|
260
|
+
? globalThis.Number(object.created_at)
|
|
261
|
+
: 0,
|
|
262
|
+
updatedAt: isSet(object.updatedAt)
|
|
263
|
+
? globalThis.Number(object.updatedAt)
|
|
264
|
+
: isSet(object.updated_at)
|
|
265
|
+
? globalThis.Number(object.updated_at)
|
|
266
|
+
: 0,
|
|
267
|
+
deletedAt: isSet(object.deletedAt)
|
|
268
|
+
? globalThis.Number(object.deletedAt)
|
|
269
|
+
: isSet(object.deleted_at)
|
|
270
|
+
? globalThis.Number(object.deleted_at)
|
|
271
|
+
: 0,
|
|
272
|
+
};
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
toJSON(message: Integration): unknown {
|
|
276
|
+
const obj: any = {};
|
|
277
|
+
if (message.id !== 0) {
|
|
278
|
+
obj.id = Math.round(message.id);
|
|
279
|
+
}
|
|
280
|
+
if (message.meta) {
|
|
281
|
+
const entries = globalThis.Object.entries(message.meta) as [string, string][];
|
|
282
|
+
if (entries.length > 0) {
|
|
283
|
+
obj.meta = {};
|
|
284
|
+
entries.forEach(([k, v]) => {
|
|
285
|
+
obj.meta[k] = v;
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (message.messenger !== "") {
|
|
290
|
+
obj.messenger = message.messenger;
|
|
291
|
+
}
|
|
292
|
+
if (message.messengerId !== "") {
|
|
293
|
+
obj.messengerId = message.messengerId;
|
|
294
|
+
}
|
|
295
|
+
if (message.userId !== 0) {
|
|
296
|
+
obj.userId = Math.round(message.userId);
|
|
297
|
+
}
|
|
298
|
+
if (message.createdAt !== 0) {
|
|
299
|
+
obj.createdAt = Math.round(message.createdAt);
|
|
300
|
+
}
|
|
301
|
+
if (message.updatedAt !== 0) {
|
|
302
|
+
obj.updatedAt = Math.round(message.updatedAt);
|
|
303
|
+
}
|
|
304
|
+
if (message.deletedAt !== 0) {
|
|
305
|
+
obj.deletedAt = Math.round(message.deletedAt);
|
|
306
|
+
}
|
|
307
|
+
return obj;
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
create<I extends Exact<DeepPartial<Integration>, I>>(base?: I): Integration {
|
|
311
|
+
return Integration.fromPartial(base ?? ({} as any));
|
|
312
|
+
},
|
|
313
|
+
fromPartial<I extends Exact<DeepPartial<Integration>, I>>(object: I): Integration {
|
|
314
|
+
const message = createBaseIntegration();
|
|
315
|
+
message.id = object.id ?? 0;
|
|
316
|
+
message.meta = (globalThis.Object.entries(object.meta ?? {}) as [string, string][]).reduce(
|
|
317
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
318
|
+
if (value !== undefined) {
|
|
319
|
+
acc[key] = globalThis.String(value);
|
|
320
|
+
}
|
|
321
|
+
return acc;
|
|
322
|
+
},
|
|
323
|
+
{},
|
|
324
|
+
);
|
|
325
|
+
message.messenger = object.messenger ?? "";
|
|
326
|
+
message.messengerId = object.messengerId ?? "";
|
|
327
|
+
message.userId = object.userId ?? 0;
|
|
328
|
+
message.createdAt = object.createdAt ?? 0;
|
|
329
|
+
message.updatedAt = object.updatedAt ?? 0;
|
|
330
|
+
message.deletedAt = object.deletedAt ?? 0;
|
|
331
|
+
return message;
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
function createBaseIntegration_MetaEntry(): Integration_MetaEntry {
|
|
336
|
+
return { key: "", value: "" };
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export const Integration_MetaEntry: MessageFns<Integration_MetaEntry> = {
|
|
340
|
+
encode(message: Integration_MetaEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
341
|
+
if (message.key !== "") {
|
|
342
|
+
writer.uint32(10).string(message.key);
|
|
343
|
+
}
|
|
344
|
+
if (message.value !== "") {
|
|
345
|
+
writer.uint32(18).string(message.value);
|
|
346
|
+
}
|
|
347
|
+
return writer;
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Integration_MetaEntry {
|
|
351
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
352
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
353
|
+
const message = createBaseIntegration_MetaEntry();
|
|
354
|
+
while (reader.pos < end) {
|
|
355
|
+
const tag = reader.uint32();
|
|
356
|
+
switch (tag >>> 3) {
|
|
357
|
+
case 1: {
|
|
358
|
+
if (tag !== 10) {
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
message.key = reader.string();
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
case 2: {
|
|
366
|
+
if (tag !== 18) {
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
message.value = reader.string();
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
reader.skip(tag & 7);
|
|
378
|
+
}
|
|
379
|
+
return message;
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
fromJSON(object: any): Integration_MetaEntry {
|
|
383
|
+
return {
|
|
384
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
385
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
386
|
+
};
|
|
387
|
+
},
|
|
388
|
+
|
|
389
|
+
toJSON(message: Integration_MetaEntry): unknown {
|
|
390
|
+
const obj: any = {};
|
|
391
|
+
if (message.key !== "") {
|
|
392
|
+
obj.key = message.key;
|
|
393
|
+
}
|
|
394
|
+
if (message.value !== "") {
|
|
395
|
+
obj.value = message.value;
|
|
396
|
+
}
|
|
397
|
+
return obj;
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
create<I extends Exact<DeepPartial<Integration_MetaEntry>, I>>(base?: I): Integration_MetaEntry {
|
|
401
|
+
return Integration_MetaEntry.fromPartial(base ?? ({} as any));
|
|
402
|
+
},
|
|
403
|
+
fromPartial<I extends Exact<DeepPartial<Integration_MetaEntry>, I>>(object: I): Integration_MetaEntry {
|
|
404
|
+
const message = createBaseIntegration_MetaEntry();
|
|
405
|
+
message.key = object.key ?? "";
|
|
406
|
+
message.value = object.value ?? "";
|
|
407
|
+
return message;
|
|
408
|
+
},
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
function createBaseGetIntegrationsResponse(): GetIntegrationsResponse {
|
|
412
|
+
return { integrations: [] };
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export const GetIntegrationsResponse: MessageFns<GetIntegrationsResponse> = {
|
|
416
|
+
encode(message: GetIntegrationsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
417
|
+
for (const v of message.integrations) {
|
|
418
|
+
Integration.encode(v!, writer.uint32(10).fork()).join();
|
|
419
|
+
}
|
|
420
|
+
return writer;
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetIntegrationsResponse {
|
|
424
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
425
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
426
|
+
const message = createBaseGetIntegrationsResponse();
|
|
427
|
+
while (reader.pos < end) {
|
|
428
|
+
const tag = reader.uint32();
|
|
429
|
+
switch (tag >>> 3) {
|
|
430
|
+
case 1: {
|
|
431
|
+
if (tag !== 10) {
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
message.integrations.push(Integration.decode(reader, reader.uint32()));
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
reader.skip(tag & 7);
|
|
443
|
+
}
|
|
444
|
+
return message;
|
|
445
|
+
},
|
|
446
|
+
|
|
447
|
+
fromJSON(object: any): GetIntegrationsResponse {
|
|
448
|
+
return {
|
|
449
|
+
integrations: globalThis.Array.isArray(object?.integrations)
|
|
450
|
+
? object.integrations.map((e: any) => Integration.fromJSON(e))
|
|
451
|
+
: [],
|
|
452
|
+
};
|
|
453
|
+
},
|
|
454
|
+
|
|
455
|
+
toJSON(message: GetIntegrationsResponse): unknown {
|
|
456
|
+
const obj: any = {};
|
|
457
|
+
if (message.integrations?.length) {
|
|
458
|
+
obj.integrations = message.integrations.map((e) => Integration.toJSON(e));
|
|
459
|
+
}
|
|
460
|
+
return obj;
|
|
461
|
+
},
|
|
462
|
+
|
|
463
|
+
create<I extends Exact<DeepPartial<GetIntegrationsResponse>, I>>(base?: I): GetIntegrationsResponse {
|
|
464
|
+
return GetIntegrationsResponse.fromPartial(base ?? ({} as any));
|
|
465
|
+
},
|
|
466
|
+
fromPartial<I extends Exact<DeepPartial<GetIntegrationsResponse>, I>>(object: I): GetIntegrationsResponse {
|
|
467
|
+
const message = createBaseGetIntegrationsResponse();
|
|
468
|
+
message.integrations = object.integrations?.map((e) => Integration.fromPartial(e)) || [];
|
|
469
|
+
return message;
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
function createBaseRemoveIntegrationRequest(): RemoveIntegrationRequest {
|
|
474
|
+
return { integrationId: 0, userId: 0 };
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export const RemoveIntegrationRequest: MessageFns<RemoveIntegrationRequest> = {
|
|
478
|
+
encode(message: RemoveIntegrationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
479
|
+
if (message.integrationId !== 0) {
|
|
480
|
+
writer.uint32(8).int32(message.integrationId);
|
|
481
|
+
}
|
|
482
|
+
if (message.userId !== 0) {
|
|
483
|
+
writer.uint32(16).int32(message.userId);
|
|
484
|
+
}
|
|
485
|
+
return writer;
|
|
486
|
+
},
|
|
487
|
+
|
|
488
|
+
decode(input: BinaryReader | Uint8Array, length?: number): RemoveIntegrationRequest {
|
|
489
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
490
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
491
|
+
const message = createBaseRemoveIntegrationRequest();
|
|
492
|
+
while (reader.pos < end) {
|
|
493
|
+
const tag = reader.uint32();
|
|
494
|
+
switch (tag >>> 3) {
|
|
495
|
+
case 1: {
|
|
496
|
+
if (tag !== 8) {
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
message.integrationId = reader.int32();
|
|
501
|
+
continue;
|
|
502
|
+
}
|
|
503
|
+
case 2: {
|
|
504
|
+
if (tag !== 16) {
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
message.userId = reader.int32();
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
reader.skip(tag & 7);
|
|
516
|
+
}
|
|
517
|
+
return message;
|
|
518
|
+
},
|
|
519
|
+
|
|
520
|
+
fromJSON(object: any): RemoveIntegrationRequest {
|
|
521
|
+
return {
|
|
522
|
+
integrationId: isSet(object.integrationId)
|
|
523
|
+
? globalThis.Number(object.integrationId)
|
|
524
|
+
: isSet(object.integration_id)
|
|
525
|
+
? globalThis.Number(object.integration_id)
|
|
526
|
+
: 0,
|
|
527
|
+
userId: isSet(object.userId)
|
|
528
|
+
? globalThis.Number(object.userId)
|
|
529
|
+
: isSet(object.user_id)
|
|
530
|
+
? globalThis.Number(object.user_id)
|
|
531
|
+
: 0,
|
|
532
|
+
};
|
|
533
|
+
},
|
|
534
|
+
|
|
535
|
+
toJSON(message: RemoveIntegrationRequest): unknown {
|
|
536
|
+
const obj: any = {};
|
|
537
|
+
if (message.integrationId !== 0) {
|
|
538
|
+
obj.integrationId = Math.round(message.integrationId);
|
|
539
|
+
}
|
|
540
|
+
if (message.userId !== 0) {
|
|
541
|
+
obj.userId = Math.round(message.userId);
|
|
542
|
+
}
|
|
543
|
+
return obj;
|
|
544
|
+
},
|
|
545
|
+
|
|
546
|
+
create<I extends Exact<DeepPartial<RemoveIntegrationRequest>, I>>(base?: I): RemoveIntegrationRequest {
|
|
547
|
+
return RemoveIntegrationRequest.fromPartial(base ?? ({} as any));
|
|
548
|
+
},
|
|
549
|
+
fromPartial<I extends Exact<DeepPartial<RemoveIntegrationRequest>, I>>(object: I): RemoveIntegrationRequest {
|
|
550
|
+
const message = createBaseRemoveIntegrationRequest();
|
|
551
|
+
message.integrationId = object.integrationId ?? 0;
|
|
552
|
+
message.userId = object.userId ?? 0;
|
|
553
|
+
return message;
|
|
554
|
+
},
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
export type MessengerServiceService = typeof MessengerServiceService;
|
|
558
|
+
export const MessengerServiceService = {
|
|
559
|
+
getIntegrations: {
|
|
560
|
+
path: "/integration.v1.MessengerService/GetIntegrations",
|
|
561
|
+
requestStream: false,
|
|
562
|
+
responseStream: false,
|
|
563
|
+
requestSerialize: (value: GetIntegrationsRequest): Buffer =>
|
|
564
|
+
Buffer.from(GetIntegrationsRequest.encode(value).finish()),
|
|
565
|
+
requestDeserialize: (value: Buffer): GetIntegrationsRequest => GetIntegrationsRequest.decode(value),
|
|
566
|
+
responseSerialize: (value: GetIntegrationsResponse): Buffer =>
|
|
567
|
+
Buffer.from(GetIntegrationsResponse.encode(value).finish()),
|
|
568
|
+
responseDeserialize: (value: Buffer): GetIntegrationsResponse => GetIntegrationsResponse.decode(value),
|
|
569
|
+
},
|
|
570
|
+
removeIntegration: {
|
|
571
|
+
path: "/integration.v1.MessengerService/RemoveIntegration",
|
|
572
|
+
requestStream: false,
|
|
573
|
+
responseStream: false,
|
|
574
|
+
requestSerialize: (value: RemoveIntegrationRequest): Buffer =>
|
|
575
|
+
Buffer.from(RemoveIntegrationRequest.encode(value).finish()),
|
|
576
|
+
requestDeserialize: (value: Buffer): RemoveIntegrationRequest => RemoveIntegrationRequest.decode(value),
|
|
577
|
+
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
578
|
+
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
579
|
+
},
|
|
580
|
+
} as const;
|
|
581
|
+
|
|
582
|
+
export interface MessengerServiceServer extends UntypedServiceImplementation {
|
|
583
|
+
getIntegrations: handleUnaryCall<GetIntegrationsRequest, GetIntegrationsResponse>;
|
|
584
|
+
removeIntegration: handleUnaryCall<RemoveIntegrationRequest, Empty>;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export interface MessengerServiceClient extends Client {
|
|
588
|
+
getIntegrations(
|
|
589
|
+
request: GetIntegrationsRequest,
|
|
590
|
+
callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void,
|
|
591
|
+
): ClientUnaryCall;
|
|
592
|
+
getIntegrations(
|
|
593
|
+
request: GetIntegrationsRequest,
|
|
594
|
+
metadata: Metadata,
|
|
595
|
+
callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void,
|
|
596
|
+
): ClientUnaryCall;
|
|
597
|
+
getIntegrations(
|
|
598
|
+
request: GetIntegrationsRequest,
|
|
599
|
+
metadata: Metadata,
|
|
600
|
+
options: Partial<CallOptions>,
|
|
601
|
+
callback: (error: ServiceError | null, response: GetIntegrationsResponse) => void,
|
|
602
|
+
): ClientUnaryCall;
|
|
603
|
+
removeIntegration(
|
|
604
|
+
request: RemoveIntegrationRequest,
|
|
605
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
606
|
+
): ClientUnaryCall;
|
|
607
|
+
removeIntegration(
|
|
608
|
+
request: RemoveIntegrationRequest,
|
|
609
|
+
metadata: Metadata,
|
|
610
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
611
|
+
): ClientUnaryCall;
|
|
612
|
+
removeIntegration(
|
|
613
|
+
request: RemoveIntegrationRequest,
|
|
614
|
+
metadata: Metadata,
|
|
615
|
+
options: Partial<CallOptions>,
|
|
616
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
617
|
+
): ClientUnaryCall;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
export const MessengerServiceClient = makeGenericClientConstructor(
|
|
621
|
+
MessengerServiceService,
|
|
622
|
+
"integration.v1.MessengerService",
|
|
623
|
+
) as unknown as {
|
|
624
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): MessengerServiceClient;
|
|
625
|
+
service: typeof MessengerServiceService;
|
|
626
|
+
serviceName: string;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
630
|
+
|
|
631
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
632
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
633
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
634
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
635
|
+
: Partial<T>;
|
|
636
|
+
|
|
637
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
638
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
639
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
640
|
+
|
|
641
|
+
function isObject(value: any): boolean {
|
|
642
|
+
return typeof value === "object" && value !== null;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function isSet(value: any): boolean {
|
|
646
|
+
return value !== null && value !== undefined;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
export interface MessageFns<T> {
|
|
650
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
651
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
652
|
+
fromJSON(object: any): T;
|
|
653
|
+
toJSON(message: T): unknown;
|
|
654
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
655
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
656
|
+
}
|