geniebox-shared-lib 2.3.0 → 2.4.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.
@@ -0,0 +1,561 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.7
5
+ // protoc v5.28.2
6
+ // source: agent.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AgentServiceService = exports.AGENT_SERVICE_NAME = exports.AgentsResponse = exports.DeleteAgentRequest = exports.ListAgentsRequest = exports.GetAgentRequest = exports.UpdateAgentRequest = exports.CreateAgentRequest = exports.Agent = exports.AGENT_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.AgentServiceControllerMethods = AgentServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const wire_1 = require("@bufbuild/protobuf/wire");
12
+ const microservices_1 = require("@nestjs/microservices");
13
+ const protobufjs_1 = require("protobufjs");
14
+ const empty_interface_1 = require("./google/protobuf/empty.interface");
15
+ const struct_interface_1 = require("./google/protobuf/struct.interface");
16
+ exports.protobufPackage = "agent";
17
+ exports.AGENT_PACKAGE_NAME = "agent";
18
+ function createBaseAgent() {
19
+ return { id: "", name: "", description: "", userId: "", visibility: "", createdAt: "", updatedAt: "" };
20
+ }
21
+ exports.Agent = {
22
+ encode(message, writer = new wire_1.BinaryWriter()) {
23
+ if (message.id !== "") {
24
+ writer.uint32(10).string(message.id);
25
+ }
26
+ if (message.name !== "") {
27
+ writer.uint32(18).string(message.name);
28
+ }
29
+ if (message.description !== "") {
30
+ writer.uint32(26).string(message.description);
31
+ }
32
+ if (message.icon !== undefined) {
33
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.icon), writer.uint32(34).fork()).join();
34
+ }
35
+ if (message.userId !== "") {
36
+ writer.uint32(42).string(message.userId);
37
+ }
38
+ if (message.instructions !== undefined) {
39
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.instructions), writer.uint32(50).fork()).join();
40
+ }
41
+ if (message.visibility !== "") {
42
+ writer.uint32(58).string(message.visibility);
43
+ }
44
+ if (message.createdAt !== "") {
45
+ writer.uint32(66).string(message.createdAt);
46
+ }
47
+ if (message.updatedAt !== "") {
48
+ writer.uint32(74).string(message.updatedAt);
49
+ }
50
+ return writer;
51
+ },
52
+ decode(input, length) {
53
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
54
+ const end = length === undefined ? reader.len : reader.pos + length;
55
+ const message = createBaseAgent();
56
+ while (reader.pos < end) {
57
+ const tag = reader.uint32();
58
+ switch (tag >>> 3) {
59
+ case 1: {
60
+ if (tag !== 10) {
61
+ break;
62
+ }
63
+ message.id = reader.string();
64
+ continue;
65
+ }
66
+ case 2: {
67
+ if (tag !== 18) {
68
+ break;
69
+ }
70
+ message.name = reader.string();
71
+ continue;
72
+ }
73
+ case 3: {
74
+ if (tag !== 26) {
75
+ break;
76
+ }
77
+ message.description = reader.string();
78
+ continue;
79
+ }
80
+ case 4: {
81
+ if (tag !== 34) {
82
+ break;
83
+ }
84
+ message.icon = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
85
+ continue;
86
+ }
87
+ case 5: {
88
+ if (tag !== 42) {
89
+ break;
90
+ }
91
+ message.userId = reader.string();
92
+ continue;
93
+ }
94
+ case 6: {
95
+ if (tag !== 50) {
96
+ break;
97
+ }
98
+ message.instructions = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
99
+ continue;
100
+ }
101
+ case 7: {
102
+ if (tag !== 58) {
103
+ break;
104
+ }
105
+ message.visibility = reader.string();
106
+ continue;
107
+ }
108
+ case 8: {
109
+ if (tag !== 66) {
110
+ break;
111
+ }
112
+ message.createdAt = reader.string();
113
+ continue;
114
+ }
115
+ case 9: {
116
+ if (tag !== 74) {
117
+ break;
118
+ }
119
+ message.updatedAt = reader.string();
120
+ continue;
121
+ }
122
+ }
123
+ if ((tag & 7) === 4 || tag === 0) {
124
+ break;
125
+ }
126
+ reader.skip(tag & 7);
127
+ }
128
+ return message;
129
+ },
130
+ };
131
+ function createBaseCreateAgentRequest() {
132
+ return { userId: "", name: "", description: "", icon: "", instructions: "", visibility: "" };
133
+ }
134
+ exports.CreateAgentRequest = {
135
+ encode(message, writer = new wire_1.BinaryWriter()) {
136
+ if (message.userId !== "") {
137
+ writer.uint32(10).string(message.userId);
138
+ }
139
+ if (message.name !== "") {
140
+ writer.uint32(18).string(message.name);
141
+ }
142
+ if (message.description !== "") {
143
+ writer.uint32(26).string(message.description);
144
+ }
145
+ if (message.icon !== "") {
146
+ writer.uint32(34).string(message.icon);
147
+ }
148
+ if (message.instructions !== "") {
149
+ writer.uint32(42).string(message.instructions);
150
+ }
151
+ if (message.visibility !== "") {
152
+ writer.uint32(50).string(message.visibility);
153
+ }
154
+ return writer;
155
+ },
156
+ decode(input, length) {
157
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
158
+ const end = length === undefined ? reader.len : reader.pos + length;
159
+ const message = createBaseCreateAgentRequest();
160
+ while (reader.pos < end) {
161
+ const tag = reader.uint32();
162
+ switch (tag >>> 3) {
163
+ case 1: {
164
+ if (tag !== 10) {
165
+ break;
166
+ }
167
+ message.userId = reader.string();
168
+ continue;
169
+ }
170
+ case 2: {
171
+ if (tag !== 18) {
172
+ break;
173
+ }
174
+ message.name = reader.string();
175
+ continue;
176
+ }
177
+ case 3: {
178
+ if (tag !== 26) {
179
+ break;
180
+ }
181
+ message.description = reader.string();
182
+ continue;
183
+ }
184
+ case 4: {
185
+ if (tag !== 34) {
186
+ break;
187
+ }
188
+ message.icon = reader.string();
189
+ continue;
190
+ }
191
+ case 5: {
192
+ if (tag !== 42) {
193
+ break;
194
+ }
195
+ message.instructions = reader.string();
196
+ continue;
197
+ }
198
+ case 6: {
199
+ if (tag !== 50) {
200
+ break;
201
+ }
202
+ message.visibility = reader.string();
203
+ continue;
204
+ }
205
+ }
206
+ if ((tag & 7) === 4 || tag === 0) {
207
+ break;
208
+ }
209
+ reader.skip(tag & 7);
210
+ }
211
+ return message;
212
+ },
213
+ };
214
+ function createBaseUpdateAgentRequest() {
215
+ return { id: "", userId: "" };
216
+ }
217
+ exports.UpdateAgentRequest = {
218
+ encode(message, writer = new wire_1.BinaryWriter()) {
219
+ if (message.id !== "") {
220
+ writer.uint32(10).string(message.id);
221
+ }
222
+ if (message.userId !== "") {
223
+ writer.uint32(18).string(message.userId);
224
+ }
225
+ if (message.name !== undefined) {
226
+ writer.uint32(26).string(message.name);
227
+ }
228
+ if (message.description !== undefined) {
229
+ writer.uint32(34).string(message.description);
230
+ }
231
+ if (message.icon !== undefined) {
232
+ writer.uint32(42).string(message.icon);
233
+ }
234
+ if (message.instructions !== undefined) {
235
+ writer.uint32(50).string(message.instructions);
236
+ }
237
+ if (message.visibility !== undefined) {
238
+ writer.uint32(58).string(message.visibility);
239
+ }
240
+ return writer;
241
+ },
242
+ decode(input, length) {
243
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
244
+ const end = length === undefined ? reader.len : reader.pos + length;
245
+ const message = createBaseUpdateAgentRequest();
246
+ while (reader.pos < end) {
247
+ const tag = reader.uint32();
248
+ switch (tag >>> 3) {
249
+ case 1: {
250
+ if (tag !== 10) {
251
+ break;
252
+ }
253
+ message.id = reader.string();
254
+ continue;
255
+ }
256
+ case 2: {
257
+ if (tag !== 18) {
258
+ break;
259
+ }
260
+ message.userId = reader.string();
261
+ continue;
262
+ }
263
+ case 3: {
264
+ if (tag !== 26) {
265
+ break;
266
+ }
267
+ message.name = reader.string();
268
+ continue;
269
+ }
270
+ case 4: {
271
+ if (tag !== 34) {
272
+ break;
273
+ }
274
+ message.description = reader.string();
275
+ continue;
276
+ }
277
+ case 5: {
278
+ if (tag !== 42) {
279
+ break;
280
+ }
281
+ message.icon = reader.string();
282
+ continue;
283
+ }
284
+ case 6: {
285
+ if (tag !== 50) {
286
+ break;
287
+ }
288
+ message.instructions = reader.string();
289
+ continue;
290
+ }
291
+ case 7: {
292
+ if (tag !== 58) {
293
+ break;
294
+ }
295
+ message.visibility = reader.string();
296
+ continue;
297
+ }
298
+ }
299
+ if ((tag & 7) === 4 || tag === 0) {
300
+ break;
301
+ }
302
+ reader.skip(tag & 7);
303
+ }
304
+ return message;
305
+ },
306
+ };
307
+ function createBaseGetAgentRequest() {
308
+ return { id: "", userId: "" };
309
+ }
310
+ exports.GetAgentRequest = {
311
+ encode(message, writer = new wire_1.BinaryWriter()) {
312
+ if (message.id !== "") {
313
+ writer.uint32(10).string(message.id);
314
+ }
315
+ if (message.userId !== "") {
316
+ writer.uint32(18).string(message.userId);
317
+ }
318
+ return writer;
319
+ },
320
+ decode(input, length) {
321
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
322
+ const end = length === undefined ? reader.len : reader.pos + length;
323
+ const message = createBaseGetAgentRequest();
324
+ while (reader.pos < end) {
325
+ const tag = reader.uint32();
326
+ switch (tag >>> 3) {
327
+ case 1: {
328
+ if (tag !== 10) {
329
+ break;
330
+ }
331
+ message.id = reader.string();
332
+ continue;
333
+ }
334
+ case 2: {
335
+ if (tag !== 18) {
336
+ break;
337
+ }
338
+ message.userId = reader.string();
339
+ continue;
340
+ }
341
+ }
342
+ if ((tag & 7) === 4 || tag === 0) {
343
+ break;
344
+ }
345
+ reader.skip(tag & 7);
346
+ }
347
+ return message;
348
+ },
349
+ };
350
+ function createBaseListAgentsRequest() {
351
+ return { userId: "", limit: 0, offset: 0 };
352
+ }
353
+ exports.ListAgentsRequest = {
354
+ encode(message, writer = new wire_1.BinaryWriter()) {
355
+ if (message.userId !== "") {
356
+ writer.uint32(10).string(message.userId);
357
+ }
358
+ if (message.limit !== 0) {
359
+ writer.uint32(16).int32(message.limit);
360
+ }
361
+ if (message.offset !== 0) {
362
+ writer.uint32(24).int32(message.offset);
363
+ }
364
+ if (message.visibility !== undefined) {
365
+ writer.uint32(34).string(message.visibility);
366
+ }
367
+ return writer;
368
+ },
369
+ decode(input, length) {
370
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
371
+ const end = length === undefined ? reader.len : reader.pos + length;
372
+ const message = createBaseListAgentsRequest();
373
+ while (reader.pos < end) {
374
+ const tag = reader.uint32();
375
+ switch (tag >>> 3) {
376
+ case 1: {
377
+ if (tag !== 10) {
378
+ break;
379
+ }
380
+ message.userId = reader.string();
381
+ continue;
382
+ }
383
+ case 2: {
384
+ if (tag !== 16) {
385
+ break;
386
+ }
387
+ message.limit = reader.int32();
388
+ continue;
389
+ }
390
+ case 3: {
391
+ if (tag !== 24) {
392
+ break;
393
+ }
394
+ message.offset = reader.int32();
395
+ continue;
396
+ }
397
+ case 4: {
398
+ if (tag !== 34) {
399
+ break;
400
+ }
401
+ message.visibility = reader.string();
402
+ continue;
403
+ }
404
+ }
405
+ if ((tag & 7) === 4 || tag === 0) {
406
+ break;
407
+ }
408
+ reader.skip(tag & 7);
409
+ }
410
+ return message;
411
+ },
412
+ };
413
+ function createBaseDeleteAgentRequest() {
414
+ return { id: "", userId: "" };
415
+ }
416
+ exports.DeleteAgentRequest = {
417
+ encode(message, writer = new wire_1.BinaryWriter()) {
418
+ if (message.id !== "") {
419
+ writer.uint32(10).string(message.id);
420
+ }
421
+ if (message.userId !== "") {
422
+ writer.uint32(18).string(message.userId);
423
+ }
424
+ return writer;
425
+ },
426
+ decode(input, length) {
427
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
428
+ const end = length === undefined ? reader.len : reader.pos + length;
429
+ const message = createBaseDeleteAgentRequest();
430
+ while (reader.pos < end) {
431
+ const tag = reader.uint32();
432
+ switch (tag >>> 3) {
433
+ case 1: {
434
+ if (tag !== 10) {
435
+ break;
436
+ }
437
+ message.id = reader.string();
438
+ continue;
439
+ }
440
+ case 2: {
441
+ if (tag !== 18) {
442
+ break;
443
+ }
444
+ message.userId = reader.string();
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
+ function createBaseAgentsResponse() {
457
+ return { agents: [], total: 0 };
458
+ }
459
+ exports.AgentsResponse = {
460
+ encode(message, writer = new wire_1.BinaryWriter()) {
461
+ for (const v of message.agents) {
462
+ exports.Agent.encode(v, writer.uint32(10).fork()).join();
463
+ }
464
+ if (message.total !== 0) {
465
+ writer.uint32(16).int32(message.total);
466
+ }
467
+ return writer;
468
+ },
469
+ decode(input, length) {
470
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
471
+ const end = length === undefined ? reader.len : reader.pos + length;
472
+ const message = createBaseAgentsResponse();
473
+ while (reader.pos < end) {
474
+ const tag = reader.uint32();
475
+ switch (tag >>> 3) {
476
+ case 1: {
477
+ if (tag !== 10) {
478
+ break;
479
+ }
480
+ message.agents.push(exports.Agent.decode(reader, reader.uint32()));
481
+ continue;
482
+ }
483
+ case 2: {
484
+ if (tag !== 16) {
485
+ break;
486
+ }
487
+ message.total = reader.int32();
488
+ continue;
489
+ }
490
+ }
491
+ if ((tag & 7) === 4 || tag === 0) {
492
+ break;
493
+ }
494
+ reader.skip(tag & 7);
495
+ }
496
+ return message;
497
+ },
498
+ };
499
+ protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_interface_1.Struct.wrap, toObject: struct_interface_1.Struct.unwrap };
500
+ function AgentServiceControllerMethods() {
501
+ return function (constructor) {
502
+ const grpcMethods = ["createAgent", "getAgent", "updateAgent", "deleteAgent", "listAgents"];
503
+ for (const method of grpcMethods) {
504
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
505
+ (0, microservices_1.GrpcMethod)("AgentService", method)(constructor.prototype[method], method, descriptor);
506
+ }
507
+ const grpcStreamMethods = [];
508
+ for (const method of grpcStreamMethods) {
509
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
510
+ (0, microservices_1.GrpcStreamMethod)("AgentService", method)(constructor.prototype[method], method, descriptor);
511
+ }
512
+ };
513
+ }
514
+ exports.AGENT_SERVICE_NAME = "AgentService";
515
+ exports.AgentServiceService = {
516
+ createAgent: {
517
+ path: "/agent.AgentService/createAgent",
518
+ requestStream: false,
519
+ responseStream: false,
520
+ requestSerialize: (value) => Buffer.from(exports.CreateAgentRequest.encode(value).finish()),
521
+ requestDeserialize: (value) => exports.CreateAgentRequest.decode(value),
522
+ responseSerialize: (value) => Buffer.from(exports.Agent.encode(value).finish()),
523
+ responseDeserialize: (value) => exports.Agent.decode(value),
524
+ },
525
+ getAgent: {
526
+ path: "/agent.AgentService/getAgent",
527
+ requestStream: false,
528
+ responseStream: false,
529
+ requestSerialize: (value) => Buffer.from(exports.GetAgentRequest.encode(value).finish()),
530
+ requestDeserialize: (value) => exports.GetAgentRequest.decode(value),
531
+ responseSerialize: (value) => Buffer.from(exports.Agent.encode(value).finish()),
532
+ responseDeserialize: (value) => exports.Agent.decode(value),
533
+ },
534
+ updateAgent: {
535
+ path: "/agent.AgentService/updateAgent",
536
+ requestStream: false,
537
+ responseStream: false,
538
+ requestSerialize: (value) => Buffer.from(exports.UpdateAgentRequest.encode(value).finish()),
539
+ requestDeserialize: (value) => exports.UpdateAgentRequest.decode(value),
540
+ responseSerialize: (value) => Buffer.from(exports.Agent.encode(value).finish()),
541
+ responseDeserialize: (value) => exports.Agent.decode(value),
542
+ },
543
+ deleteAgent: {
544
+ path: "/agent.AgentService/deleteAgent",
545
+ requestStream: false,
546
+ responseStream: false,
547
+ requestSerialize: (value) => Buffer.from(exports.DeleteAgentRequest.encode(value).finish()),
548
+ requestDeserialize: (value) => exports.DeleteAgentRequest.decode(value),
549
+ responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
550
+ responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
551
+ },
552
+ listAgents: {
553
+ path: "/agent.AgentService/listAgents",
554
+ requestStream: false,
555
+ responseStream: false,
556
+ requestSerialize: (value) => Buffer.from(exports.ListAgentsRequest.encode(value).finish()),
557
+ requestDeserialize: (value) => exports.ListAgentsRequest.decode(value),
558
+ responseSerialize: (value) => Buffer.from(exports.AgentsResponse.encode(value).finish()),
559
+ responseDeserialize: (value) => exports.AgentsResponse.decode(value),
560
+ },
561
+ };
@@ -0,0 +1,91 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * `NullValue` is a singleton enumeration to represent the null value for the
5
+ * `Value` type union.
6
+ *
7
+ * The JSON representation for `NullValue` is JSON `null`.
8
+ */
9
+ export declare enum NullValue {
10
+ /** NULL_VALUE - Null value. */
11
+ NULL_VALUE = 0,
12
+ UNRECOGNIZED = -1
13
+ }
14
+ /**
15
+ * `Struct` represents a structured data value, consisting of fields
16
+ * which map to dynamically typed values. In some languages, `Struct`
17
+ * might be supported by a native representation. For example, in
18
+ * scripting languages like JS a struct is represented as an
19
+ * object. The details of that representation are described together
20
+ * with the proto support for the language.
21
+ *
22
+ * The JSON representation for `Struct` is JSON object.
23
+ */
24
+ export interface Struct {
25
+ /** Unordered map of dynamically typed values. */
26
+ fields: {
27
+ [key: string]: any | undefined;
28
+ };
29
+ }
30
+ export interface Struct_FieldsEntry {
31
+ key: string;
32
+ value?: any | undefined;
33
+ }
34
+ /**
35
+ * `Value` represents a dynamically typed value which can be either
36
+ * null, a number, a string, a boolean, a recursive struct value, or a
37
+ * list of values. A producer of value is expected to set one of these
38
+ * variants. Absence of any variant indicates an error.
39
+ *
40
+ * The JSON representation for `Value` is JSON value.
41
+ */
42
+ export interface Value {
43
+ /** Represents a null value. */
44
+ nullValue?: NullValue | undefined;
45
+ /** Represents a double value. */
46
+ numberValue?: number | undefined;
47
+ /** Represents a string value. */
48
+ stringValue?: string | undefined;
49
+ /** Represents a boolean value. */
50
+ boolValue?: boolean | undefined;
51
+ /** Represents a structured value. */
52
+ structValue?: {
53
+ [key: string]: any;
54
+ } | undefined;
55
+ /** Represents a repeated `Value`. */
56
+ listValue?: Array<any> | undefined;
57
+ }
58
+ /**
59
+ * `ListValue` is a wrapper around a repeated field of values.
60
+ *
61
+ * The JSON representation for `ListValue` is JSON array.
62
+ */
63
+ export interface ListValue {
64
+ /** Repeated field of dynamically typed values. */
65
+ values: any[];
66
+ }
67
+ export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
68
+ export declare const Struct: MessageFns<Struct> & StructWrapperFns;
69
+ export declare const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry>;
70
+ export declare const Value: MessageFns<Value> & AnyValueWrapperFns;
71
+ export declare const ListValue: MessageFns<ListValue> & ListValueWrapperFns;
72
+ export interface MessageFns<T> {
73
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
74
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
75
+ }
76
+ export interface StructWrapperFns {
77
+ wrap(object: {
78
+ [key: string]: any;
79
+ } | undefined): Struct;
80
+ unwrap(message: Struct): {
81
+ [key: string]: any;
82
+ };
83
+ }
84
+ export interface AnyValueWrapperFns {
85
+ wrap(value: any): Value;
86
+ unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
87
+ }
88
+ export interface ListValueWrapperFns {
89
+ wrap(array: Array<any> | undefined): ListValue;
90
+ unwrap(message: ListValue): Array<any>;
91
+ }